Skip to content

Account: Send a X-Request-ID header #5853#5897

Merged
guruz merged 2 commits intomasterfrom
request-id
Jul 13, 2017
Merged

Account: Send a X-Request-ID header #5853#5897
guruz merged 2 commits intomasterfrom
request-id

Conversation

@ckamm
Copy link
Contributor

@ckamm ckamm commented Jul 13, 2017

No description provided.

src/cmd/cmd.cpp Outdated
#endif

qsrand(QTime::currentTime().msec() * QCoreApplication::applicationPid());
qsrand(QDateTime::currentMSecsSinceEpoch());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this? I remember this was be added for smashbox doing parallel testing which had before this lead to duplicate transferids used in chunking

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, makes sense to leave in the pid then. My complaint was that msec() just has values between 0-999.

@ckamm
Copy link
Contributor Author

ckamm commented Jul 13, 2017

@ogoffart QUuid has curly braces, which can't appear. And not being limited to hex digits allows for shorter ids. Will update.

@guruz
Copy link
Contributor

guruz commented Jul 13, 2017

People on the internet seem to be using this header with smaller values separated by dashes.. (looks UUIDish..)

but no braces..

src/cmd/cmd.cpp Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this overflow? both calls return (signed) qint64
Epoch should be ~40 bits and i don't know how many bits is PID on windows for example.
could be worth casting to unsiged.

I would suggest qHash(QDateTime::currentMSecsSinceEpoch()) ^ qhash(QCoreApplication::applicationPid())

@butonic
Copy link

butonic commented Jul 13, 2017

Uuid is perfect as request id.

@butonic
Copy link

butonic commented Jul 13, 2017

We could allow curly braces on the server side. Discuss with @PVince81 or @tomneedham while I am on vacation ;-)

Copy link
Contributor

@ogoffart ogoffart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect

@guruz guruz merged commit bd107e1 into master Jul 13, 2017
@guruz guruz deleted the request-id branch July 13, 2017 16:06
@butonic
Copy link

butonic commented Jul 14, 2017

Oh and yes, the request id must be uniqe for every request so it can be logged and traced through the whole server side stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants