fix(grpc-mongo): per-call deadlines so paced NextToken doesn't time out#235
Open
slayerjain wants to merge 1 commit into
Open
fix(grpc-mongo): per-call deadlines so paced NextToken doesn't time out#235slayerjain wants to merge 1 commit into
slayerjain wants to merge 1 commit into
Conversation
The client wrapped SeedTokens + 10 deliberately-paced NextToken calls in a single shared 20s absolute-deadline context. With 1s of pacing between calls plus the server's 500ms work plus keploy's proxyless-capture warmup, the cumulative wall-clock approached 20s on a loaded CI runner, so NextToken #9 sporadically failed with "rpc error: code = DeadlineExceeded" and exited 1 (flaky grpc-mongo step in the enterprise CI). Give each RPC its own bounded (10s) context. The inter-call pacing no longer eats into a later call's budget, so the run is deterministic; the assertions are unchanged (11 captures, every token asserted) and a genuinely hung RPC still times out at the per-call deadline. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
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.
Problem
The grpc-mongo client wraps
SeedTokens+ 10 deliberately-pacedNextTokencalls in a single shared 20s absolute-deadline context. With ~1s of pacing between calls + the server's 500ms work + keploy's proxyless-capture warmup, the cumulative wall-clock approaches 20s on a loaded CI runner, soNextToken #9sporadically fails:This is a flaky step in the keploy enterprise CI (
grpc-linux/run-grpc-mongo): it passes in most runs, fails under contention.Fix
Give each RPC its own bounded (10s) context. The inter-call pacing no longer eats into a later call's budget, so the run is deterministic. Assertions unchanged — still 11 captures, every token asserted — and a genuinely hung RPC still times out at the per-call deadline. Not a shortcut: the shared absolute deadline was the structural bug.
The enterprise CI clones samples-go
main, so this needs merging for the fix to land in CI; the grpc-mongo flake class is then verified by repeated enterprise pipeline runs.