Add jitter to matching long poll deadlines#10161
Open
baekgyu-kim wants to merge 2 commits intotemporalio:mainfrom
Open
Add jitter to matching long poll deadlines#10161baekgyu-kim wants to merge 2 commits intotemporalio:mainfrom
baekgyu-kim wants to merge 2 commits intotemporalio:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Added up to 5% jitter to Matching long poll deadlines so empty long polls do not all expire at the same time after mass poll cancellation.
Fixes #6843.
Why?
When many long polls are cancelled or expire together, SDK workers can retry in alignment and create a synchronized polling burst. Subtracting a small randomized amount from the Matching long poll timeout spreads those retries while preserving the existing deadline buffer behavior.
How did you test it?
make binsand built all server/tool binaries successfully.make startand verified namespace/cluster health via Temporal CLI.TestJitteredLongPollTimeoutfor deterministic jitter timeout calculation coverage.Potential risks
The effective long poll timeout can be shortened by up to 5%. The jitter is bounded and does not change the existing
returnEmptyTaskTimeBudgetdeadline buffer.