Repository navigation
fix(batching): preserve peers when a batch request is cancelled - #2638
Open
DiadkoShmek wants to merge 1 commit into
Open
DiadkoShmek wants to merge 1 commit into
DiadkoShmek wants to merge 1 commit into
Conversation
|
|
Author
|
CLA Assistant currently displays Seldon CLA version 2024-04-12, section 3, stating that the Contribution "will infringe upon or misappropriate" third-party rights. Could you confirm whether "will not infringe" is intended and correct the displayed agreement? I can complete the CLA after that wording is clarified. |
This branch has not been deployed
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
Cancelling one prediction in an adaptive batch can prevent a different, still-active prediction from receiving its response.
_wait_responseremoves the cancelled request's Future;_predict_callbackthen indexes the missing ID, raisesKeyError, and indexes it again while distributing that error. A cancelled first member can strand its peer, while a cancelled last member produces an unhandled event-loop callback error.Deliver batch results and model errors only to present, unfinished Futures. Apply the same completed-Future guard when clearing a failed queue. Shared model prediction continues, and the surviving request receives its original result or model exception.
Changes Made
_predict_callbackand_clear_queue.load_batching/modelpredictregressions using a gated synthetic SumModel, real merge/split and numeric codecs. Cover cancellation of either member, successful/error model outcomes, no-cancellation controls and recovery through the same batcher.Related Issues
Source-audited defect; no existing issue selected. Bounded all-state batching/cancellation searches found no matching fix.
Validation
git diff --checkand fullmypy ./mlserverpass (101 source files).The public Python batching boundary is tested. HTTP/gRPC disconnect behavior, cancellation of the shared prediction task and the full integration/runtime matrix were not tested. No provider calls or model downloads were used.
Checklist
Additional Notes
AI assistance: OpenAI Codex performed source inspection, implementation, local verification and independent AI review. No human review or upstream-team membership is claimed.