fix: do not arm client-side timeout on long-lived gRPC streams#680
Merged
Conversation
StreamActivatedJobs has no requestTimeout field, but the generic Stream wrapper fell back to longPoll (50 s) and destroyed the stream after ~51 s. Only the sidecar poll continued working, capping throughput at ~70-100 jobs/s instead of the expected ~1000. Guard the timeout so it only fires when requestTimeout is explicitly set on the request, leaving long-lived streams untouched.
Collaborator
|
Successfully created backport PR for |
|
Released in |
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.
Description of the change
The generic
${methodName}Streamwrapper inGrpcClient.tsarms a client-side timeout on all streaming RPCs, usingrequestTimeout ?? longPollas the duration.StreamActivatedJobshas norequestTimeoutfield, so the fallback tolongPoll(default 50 s) fires after ~51 s, emitting'end'and destroying the stream. SinceZBStreamWorkerhas no reconnection logic, the stream dies silently and only the sidecar poll (every 30 s, max 32 jobs) continues — capping throughput at ~70-100 jobs/s instead of the expected ~1000.Fix
Guard the timeout so it only fires when
requestTimeoutis explicitly set on the request (!= null && !== 0 && !== -1), leaving long-lived streams untouched.Type of change
Checklist
mainbranch