Repository navigation
Fail fast when the continuous batching background thread has died - #48301
Closed
qgallouedec wants to merge 3 commits into
Closed
qgallouedec wants to merge 3 commits into
qgallouedec wants to merge 3 commits into
Conversation
When the generation loop dies on a fatal error, add_request kept accepting requests and get_result returned None until the caller's timeout, so a generate_batch user saw a silent timeout with no trace of the underlying error. Raise from fatal_error in add_request, and in get_result once the remaining results are drained.
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Contributor
CI recapDashboard: View test results in Grafana |
Merged
Collaborator
|
Thanks for raising the issue! It's true the failing is a bit slow, but this touches some pretty core part of the code, so I opened this PR #48334 instead with a bit more fixes. LMK if that does the trick for you. |
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 does this PR do?
Fixes the secondary problem reported in #48298 (silent timeouts after the background thread dies). Part of #48294.
Change:
add_requestraises immediately whenfatal_erroris set, andget_resultraises once the remaining results are drained, both chainingfrom self.fatal_errorso the root cause is in the traceback.get_result's blocking wait is chunked into 1s slices so a thread dying mid-wait is noticed within a second rather than after the caller's full timeout (the death usually happens after the caller has already started waiting).Before/after, submitting to a manager whose background thread died (here: a model unsupported by CB).
Before:
add_requestaccepts the requests andget_resultreturnsNoneuntil the caller's timeout. Nothing surfaces the error, it is only in the logs:After: the caller gets the error 1.2s after startup, with the root cause chained:
Who can review?
@remi-or (continuous batching)