Skip to content

Answer a full query queue 429, as PHP does - #975

Merged
rmcdaniel merged 3 commits into
mainfrom
rust-964-query-queue-full-429
Nov 3, 2026
Merged

rmcdaniel merged 3 commits into
mainfrom
rust-964-query-queue-full-429

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

Review tier B: HTTP status and body parity on a single refusal. No storage, locking or auth change.

Stacked on #965 (follow-up to #964). Draft until #965 merges, after which the diff is only this change.

Change

PHP's WorkflowQueryTaskBroker answers QueryTaskQueueFullException with queryFailed(..., 'query_task_queue_full', $message, 429): the query refusal body, and no Retry-After. Native answered a bare 503, so clients that back off on 429 treated a full queue as a server fault.

Native now answers 429 with PHP's body: workflow_id, run_id, target_scope, query_name, result: null, reason and message, plus the existing control-plane envelope.

  • Message: PHP's exact wording, "Query task queue [] in namespace [] reached the configured pending limit of ."
  • Limit: whichever native bound refused the query, MAX_PENDING (16) or MAX_ENTRIES (64).
  • Also covered: the same answer applies when the namespace's open set is full at filing time.
  • Unchanged: the cutover's internal refusal.

No SDK change is needed: the reason is already in the control-plane contract's rejection reasons.

Tests

queries_bound_abandoned_requests_reclaim_expired_entries_and_deliver_worker_failure now checks 429, the refusal body and the exact message. All 42 query execution tests pass on SQLite.

🤖 Generated with Claude Code

PHP's WorkflowQueryTaskBroker catches QueryTaskQueueFullException and
answers queryFailed(..., 'query_task_queue_full', message, 429), with the
query refusal body and no Retry-After. Native answered a bare 503
refusal, so clients that back off on 429 treated a full queue as a
server fault.

Native now answers 429 with PHP's body (workflow_id, run_id,
target_scope, query_name, result null, reason and message) and PHP's
message: "Query task queue [<queue>] in namespace [<namespace>] reached
the configured pending limit of <limit>." The limit is whichever native
bound refused the query: MAX_PENDING open queries, or MAX_ENTRIES
listed. The same answer covers a full open set at filing time. The
cutover's internal refusal is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmcdaniel
rmcdaniel marked this pull request as ready for review November 3, 2026 00:55
@rmcdaniel

Copy link
Copy Markdown
Member Author

Security bounded review of exact head 14eb69dc542d5ddb1fcd7c2b3d14142141647d84: source clear for the 429 parity change.

The merge base is the protected-main commit that merged #965, and the resulting delta is exactly queries.rs plus its execution assertion. No query-cache storage, lock, cutover, authorization, or routing behavior changes.

  • The ordinary admission limits now use the existing query-refusal protocol response with HTTP 429, query_task_queue_full, the bound workflow/run/query identity, target_scope=instance, null result, and PHP's exact queue/namespace/limit message.
  • The selected limit is 16 when the pending bound is reached, otherwise the 64-entry defensive bound. The post-insert list_open capacity refusal is translated to the same customer response and its uncommitted insert remains inside the transaction, so it rolls back.
  • The one-time 3.0.1 cutover still handles a full legacy open set internally and does not gain the customer-facing mapping.
  • No Retry-After header path is introduced. The status change therefore matches the recorded SDK survey rather than granting new retry or authority behavior.
  • The focused test discriminates the old bare 503 and binds 429, reason, identity fields, null result, nonempty run ID, and exact 16-limit message.

Hosted checks are rerunning on this rebased exact head, so this is source clearance only. Final carry requires the terminal hosted result; any source change needs re-review.

@rmcdaniel

Copy link
Copy Markdown
Member Author

Security bounded source review of exact head 14eb69dc542d5ddb1fcd7c2b3d14142141647d84: source-clear for the Tier-B 429 parity change.

The refusal remains inside the serialized admission transaction, creates no row on either bound, and now carries the exact workflow/run/query/queue/namespace context through the existing query-refusal envelope. The 16-open path reports 16; the open-set filing refusal is translated only from query_task_queue_full and reports the 64-entry hard bound. Other filing errors still propagate unchanged. No retry header, auth, storage, or SDK behavior is added.

The regression proves 429, reason, exact context/body/message and the active 16 limit; all hosted checks on this head are terminal green. This is a bounded source clearance only: the branch is stacked on #965's merge commit and must be carried onto the eventual 3.0.3 main tip, with a zero-unexpected-diff readback and terminal checks, before merge/release clearance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmcdaniel

rmcdaniel commented Nov 3, 2026 •

Copy link
Copy Markdown
Member Author

Security carry review at exact c2493e1549c855da686c4e36b1f5634a9bb14436: this is a two-parent merge of the previously source-cleared 14eb69dc542d5ddb1fcd7c2b3d14142141647d84 and current main 0e6fc80a34941098696c53f42289874cf9f98d15. The feature delta remains exactly rust/src/runtime/queries.rs plus rust/tests/execution.rs, and both paths are byte-identical to the cleared head. Source carry is clear; merge clearance remains bounded on the fresh hosted checks, which are still running with no failure currently reported.

@sonarqubecloud

sonarqubecloud Bot commented Nov 3, 2026

Copy link
Copy Markdown

@rmcdaniel

Copy link
Copy Markdown
Member Author

Security final clearance at exact carry head c2493e1549c855da686c4e36b1f5634a9bb14436. The feature paths remain byte-identical to the previously reviewed 429-parity source, the carry is only current main, and all hosted checks are terminal green. Clear to merge for 3.0.3.

@rmcdaniel
rmcdaniel added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 1854d0f Nov 3, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant