fix: handle RouteHandle::submit returning SubmitOutcome#199
Open
peshence wants to merge 1 commit into
Open
Conversation
Adapt to bits crate API change where RouteHandle::submit now returns SubmitOutcome instead of bare JobHandle, enforcing broker-wide max_jobs. - v1 API: match SubmitOutcome, return HTTP 529 with v1 error format - v2 API: match SubmitOutcome, return HTTP 529 with v2 error format - EDR/lib.rs: match SubmitOutcome, return SubmitError::Upstream - Update bits dependency to fix/shared-submit-admission branch
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the polytope-server frontend to accommodate a bits API change where RouteHandle::submit now returns a SubmitOutcome (enabling broker-wide admission control via max_jobs) and maps Overloaded outcomes into consistent HTTP/API-level overload responses.
Changes:
- Handle
SubmitOutcome::{Accepted, Overloaded}across v1, v2, and EDR submission paths. - Return HTTP 529 with
Retry-Afterand aretryable: trueJSON payload when the broker is at capacity. - Bump the
bits-brokergit dependency revision (and associatedCargo.lockentry).
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/lib.rs | EDR submission path now matches on SubmitOutcome and returns an upstream submit error on overload. |
| frontend/src/api/v2.rs | v2 submit endpoint now handles SubmitOutcome, logging and returning an overload (529) response when at capacity. |
| frontend/src/api/v1.rs | v1 submit endpoint now handles SubmitOutcome, logging and returning an overload (529) response when at capacity. |
| frontend/Cargo.toml | Updates bits git dependency rev to pick up the new SubmitOutcome API. |
| Cargo.lock | Locks the updated bits git revision. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Adapt to bits crate API change where
RouteHandle::submitnow returnsSubmitOutcomeinstead of bareJobHandle, enforcing broker-widemax_jobsadmission control on all submission paths.Changes
frontend/src/api/v2.rs— match onSubmitOutcome, return HTTP 529 with{"error": ..., "retryable": true}onOverloadedfrontend/src/api/v1.rs— match onSubmitOutcome, return HTTP 529 with{"status": "failed", "message": ..., "retryable": true}onOverloadedfrontend/src/lib.rs— EDR collection path matchesSubmitOutcome, returnsErr(SubmitError::Upstream(...))onOverloadedfrontend/Cargo.toml— bits dependency updated torev = 9eb29779SubmitOutcometouse bits::{...}in v1 and v2 modulesDepends on
Tested
cargo check✅cargo test -p polytope-server✅ (183 tests pass)