docs: require min-instances and no-cpu-throttling for the worker - #145
Merged
Merged
Conversation
The worker drains the outbox on its own timer rather than per request, so it only works while its process is alive and holding CPU. The documented deploy omitted both flags, and a deployment without them fails quietly: payments still settle through the API, but supplier deliveries sit in PENDING and requests stay on "Retrieving result". The failure is intermittent, which makes it easy to misdiagnose as a UI or state-machine fault. Any request that reaches the service boots an instance, and startup drains the backlog before the timer takes over, so the queue appears to clear itself and then stalls again.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
oneshot | 314106e | Sep 13 2026, 03:01 PM |
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
The documented worker deploy omitted
--min-instances=1and--no-cpu-throttling. Following it as written reproduces the outage we just had.The worker is not request-driven: it drains the outbox on its own timer, so it only works while its process is alive and holding CPU. Without those flags Cloud Run stops the idle container and throttles CPU between requests, and the timer stops with it. The failure is quiet — payments still settle through the API, because user-wallet settlement never touches the worker — but supplier deliveries sit in
PENDINGand every request stays on "Retrieving result".It is also intermittent, which is what made it expensive to diagnose: any request that reaches the service boots an instance, and
RestartRunner.start()drains the backlog before the timer takes over, so the queue appears to clear itself and then stalls again.Scope and acceptance criteria
Documentation only. No source, schema, or behaviour change.
Product and security invariants
Invariant notes:
Not applicable: no code path changes. The added flags affect instance lifecycle only and grant no new authority.
Validation
Independent review evidence
Gate A — exact candidate tree before push
free-pi-cliGate B — exact remote PR head
Reviewer tool:
free-pi-cliVerdict: not run, same reason.
Agent policy / repository-policyand all applicable CI checks pass.Risk and rollback
--min-instances=1means the worker no longer scales to zero, which costs more than an idle service did. That is the intended trade: a settlement worker that sleeps does not do its job.Human merge