fix(client): treat any 4xx on stop as already-stopped, not an error#11
Closed
derencius wants to merge 1 commit into
Closed
fix(client): treat any 4xx on stop as already-stopped, not an error#11derencius wants to merge 1 commit into
derencius wants to merge 1 commit into
Conversation
cancel_workflow only swallowed 404/410 and re-raised other client errors. A 400 (run already terminal on the API) escaped as a raw Faraday::BadRequestError — which isn't an OutputWorkflows::APIError, so the caller's rescue missed it and the whole job failed. ATLAS-11Z: Sitemap::HealthAuditJob died 69 times in 4 days cancelling a concurrent execution whose run was already done. Any 4xx on the stop call means the run can't be stopped (terminal, gone, or expired) — functionally already stopped — so return false instead of raising. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Member
Author
|
Superseded by #12 — recreated with a clean commit message (this is a public repo; the original message referenced internal infra). |
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.
Problem
cancel_workflowonly treated 404/410 as "already stopped" and re-raised every other client error. The API returns 400 when a run is already in a terminal state — that escaped as a rawFaraday::BadRequestError, which isn't anOutputWorkflows::APIError, so callers that rescueAPIError(e.g. when cancelling a concurrent execution before dispatching a new one) missed it and failed.Fix
Any 4xx on the stop call means the run can't be stopped (terminal, gone, or expired) — functionally "already stopped". Return
falseinstead of re-raising.Testing
false(400/409 previously raised — TDD red confirmed).🤖 Generated with Claude Code