Skip to content

fix: handle RouteHandle::submit returning SubmitOutcome#199

Open
peshence wants to merge 1 commit into
upstreamfrom
fix/bits-submit-outcome
Open

fix: handle RouteHandle::submit returning SubmitOutcome#199
peshence wants to merge 1 commit into
upstreamfrom
fix/bits-submit-outcome

Conversation

@peshence

@peshence peshence commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adapt to bits crate API change where RouteHandle::submit now returns SubmitOutcome instead of bare JobHandle, enforcing broker-wide max_jobs admission control on all submission paths.

Changes

  • frontend/src/api/v2.rs — match on SubmitOutcome, return HTTP 529 with {"error": ..., "retryable": true} on Overloaded
  • frontend/src/api/v1.rs — match on SubmitOutcome, return HTTP 529 with {"status": "failed", "message": ..., "retryable": true} on Overloaded
  • frontend/src/lib.rs — EDR collection path matches SubmitOutcome, returns Err(SubmitError::Upstream(...)) on Overloaded
  • frontend/Cargo.toml — bits dependency updated to rev = 9eb29779
  • Imports — added SubmitOutcome to use bits::{...} in v1 and v2 modules

Depends on

Tested

  • cargo check
  • cargo test -p polytope-server ✅ (183 tests pass)
  • Deployed to LUMI dev — health check and test collection submit/retrieve working

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-After and a retryable: true JSON payload when the broker is at capacity.
  • Bump the bits-broker git dependency revision (and associated Cargo.lock entry).

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.

@peshence peshence requested a review from jameshawkes June 18, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants