Skip to content
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

Merged
merged 7 commits into from
Nov 13, 2024

Conversation

Stevenjin8
Copy link
Contributor

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.

@Stevenjin8 Stevenjin8 marked this pull request as draft November 1, 2024 22:59
@Stevenjin8 Stevenjin8 marked this pull request as ready for review November 1, 2024 23:09
@Stevenjin8
Copy link
Contributor Author

/cc @keithmattix

@Stevenjin8
Copy link
Contributor Author

/assign @Stevenjin8

Copy link
Contributor

@KBaichoo KBaichoo left a 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

@KBaichoo
Copy link
Contributor

KBaichoo commented Nov 4, 2024

/wait

Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @markdroth
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #36953 was synchronize by Stevenjin8.

see: more, trace.

@Stevenjin8 Stevenjin8 requested a review from KBaichoo November 5, 2024 18:14
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]>
@Stevenjin8
Copy link
Contributor Author

/retest

Signed-off-by: Steven Jin Xuan <[email protected]>
@Stevenjin8
Copy link
Contributor Author

/retest

@markdroth
Copy link
Contributor

/lgtm api

@repokitteh-read-only repokitteh-read-only bot removed the api label Nov 8, 2024
@Stevenjin8
Copy link
Contributor Author

@KBaichoo Bump

KBaichoo
KBaichoo previously approved these changes Nov 12, 2024
Copy link
Contributor

@KBaichoo KBaichoo left a 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!

changelogs/current.yaml Outdated Show resolved Hide resolved
Signed-off-by: Steven Jin Xuan <[email protected]>
@Stevenjin8
Copy link
Contributor Author

/retest

@KBaichoo KBaichoo merged commit b422688 into envoyproxy:main Nov 13, 2024
25 checks passed
Stevenjin8 added a commit to Stevenjin8/envoy that referenced this pull request Dec 4, 2024
Signed-off-by: Steven Jin Xuan <[email protected]>
Stevenjin8 added a commit to Stevenjin8/envoy that referenced this pull request Dec 4, 2024
Signed-off-by: Steven Jin Xuan <[email protected]>
@Stevenjin8 Stevenjin8 mentioned this pull request Dec 4, 2024
phlax pushed a commit that referenced this pull request Dec 5, 2024
Signed-off-by: Steven Jin Xuan <[email protected]>
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.

3 participants