Skip to content

collector: accept any 2xx status from the leader - #4923

Merged
jcjones merged 1 commit into
mainfrom
jcj/4894-lenient-success-status
Oct 20, 2026
Merged

jcjones merged 1 commit into
mainfrom
jcj/4894-lenient-success-status

Conversation

@jcjones

@jcjones jcjones commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Recent DAP drafts only require "a successful status code", so collection job creation and polling no longer insist on 200 OK, which we need to reflect for interoperability.

Location Request Before After
collector/src/lib.rs:713 (send_collection_request) Collector → Leader: create collection job (POST) Exactly 200 OK Changed: any 2xx
collector/src/lib.rs:763 (poll_once) Collector → Leader: poll collection job (GET) Exactly 200 OK Changed: any 2xx except 204, which Janus leaders send for deleted jobs
collector/src/lib.rs:956 (delete_collection_job) Collector → Leader: delete collection job (DELETE) Any 2xx Unchanged
client/src/lib.rs:744 Client → Leader: upload reports Any 2xx Unchanged
client/src/lib.rs:854 Client → OHTTP relay: upload over OHTTP Any 2xx Unchanged
core/src/http/cached_resource.rs:140 Client → Aggregators: fetch HPKE configs Any 2xx Unchanged
core/src/retries.rs:358 (retry_http_request), used by send_request_to_helper (aggregator/src/aggregator.rs:4206) Leader → Helper: aggregation jobs and aggregate shares Only 4xx/5xx are errors Unchanged

The leader answers a poll on a deleted collection job with 204 No Content and an empty body. If the collector treated that as success, it would read the empty body as "not ready" and poll forever, so poll_once still treats 204 as an error.

Closes #4894

Authored with Opus 5.5

Recent DAP drafts only require "a successful status code", so collection
job creation and polling no longer insist on 200 OK. A 204 on poll is
still an error, since Janus leaders use it for deleted collection jobs.

Closes #4894
@jcjones
jcjones requested a review from a team as a code owner October 20, 2026 15:47

@divergentdave divergentdave left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

FWIW status handling in the client and aggregator look good.

@jcjones
jcjones merged commit 5b0ae71 into main Oct 20, 2026
9 checks passed
@jcjones
jcjones deleted the jcj/4894-lenient-success-status branch October 20, 2026 17:34
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.

Make HTTP clients less picky about status codes

3 participants