-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Take absolute values when doing DNS jitter. #36953
Conversation
/cc @keithmattix |
/assign @Stevenjin8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly looks good, thank you
/wait |
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
Signed-off-by: Steven Jin Xuan <[email protected]>
Signed-off-by: Steven Jin Xuan <[email protected]>
Signed-off-by: Steven Jin Xuan <[email protected]>
Signed-off-by: Steven Jin Xuan <[email protected]>
Signed-off-by: Steven Jin Xuan <[email protected]>
7f05fe3
to
7ccd6d5
Compare
/retest |
Signed-off-by: Steven Jin Xuan <[email protected]>
6e8e501
to
73b2825
Compare
/retest |
/lgtm api |
@KBaichoo Bump |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise lgtm, thank you!
Signed-off-by: Steven Jin Xuan <[email protected]>
/retest |
Signed-off-by: Steven Jin Xuan <[email protected]>
Signed-off-by: Steven Jin Xuan <[email protected]>
Signed-off-by: Steven Jin Xuan <[email protected]>
Commit Message: Take absolute values when doing DNS jitter.
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue] #36943
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]
In response to #36943. Jitter is generated by taking a random value from the random generator and creating a std::chrono::millisecond.
Since the random value is a uint64, I figured that the resulting std::chrono::millisecond would have to be positive.
However, std::chrono::millisecond uses a int64 under the hood, so large random values were being converted to negative numbers.
For example, if the random generator returned 0x8000000000000000, there would be a jitter of -9223372036854775808ms.
This jitter would in turn case the refresh timer to be negative.