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

release notes

d4f758a
Select commit
Loading
Failed to load commit list.
Merged

Take absolute values when doing DNS jitter. #36953

release notes
d4f758a
Select commit
Loading
Failed to load commit list.
CI (Envoy) / Mobile/iOS tests skipped Nov 12, 2024 in 0s

Check was skipped

This check was not triggered in this CI run

Details

Request (pr/36953/main@d4f758a)

Stevenjin8 @Stevenjin8 d4f758a #36953 merge main@3a1a72e

Take absolute values when doing DNS jitter.

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.

Environment

Request variables

Key Value
ref e7e31a4
sha d4f758a
pr 36953
base-sha 3a1a72e
actor Stevenjin8 @Stevenjin8
message Take absolute values when doing DNS jitter....
started 1731437528.805574
target-branch main
trusted false
Build image

Container image/s (as used in this CI run)

Key Value
default envoyproxy/envoy-build-ubuntu:f94a38f62220a2b017878b790b6ea98a0f6c5f9c
mobile envoyproxy/envoy-build-ubuntu:mobile-f94a38f62220a2b017878b790b6ea98a0f6c5f9c
Version

Envoy version (as used in this CI run)

Key Value
major 1
minor 33
patch 0
dev true