fix(runtime): reconcile workflow timeouts fail closed - #1132
Merged
Conversation
…conciliation `_workflow_has_timed_out` wrapped both timestamp parses in `except Exception: return False`, so any unparseable value reported "not timed out". A RUNNING workflow whose recorded `started_at` could not be parsed therefore had no derivable deadline and stayed RUNNING for the lifetime of the control plane: reconciliation could never reclaim it, even decades past a one-second timeout. The two timestamps have different scope, so they are now handled differently: - `submitted_at` is the caller's reconciliation clock and governs every workflow in the pass, so an unusable value raises instead of quietly disabling all timeouts. The HTTP adapter already maps `ValueError` to 409 for this route. - A per-workflow `started_at` that cannot be parsed no longer blocks reclamation; the workflow is timed out under a distinct terminal reason so it stays diagnosable rather than looking like an ordinary timeout. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`timeout_seconds` carries no declared upper bound, so adding it to the start instant overflowed for a very large value — as a float timestamp and as a `timedelta`. The previous blanket `except Exception` hid that as "not timed out"; with the exception handling narrowed, it would instead abort the whole reconciliation pass and surface as a 500. Elapsed time is now compared against the timeout, which Python evaluates exactly for an arbitrarily large integer. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
doublewhy
marked this pull request as ready for review
August 12, 2026 21:01
This was referenced Aug 13, 2026
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.
Plain-language summary
Issue closed
Closes #1102
What changed
started_at <= updated_at <= reconciliation clock.total_seconds()or overflow-prone timestamp addition.Verification
devlibvirt tests that require/usr/bin/busyboxand are addressed separately by fix(libvirt): bind reproducible guest operations to fresh evidence #1128.devat3d6e369b726607ff657a841c7f1dee0bec655b8f.Scope
This PR covers only workflow timeout proof and reconciliation. Concurrent participant reservations/settlement (#1101), HTTP admission, and durable operation storage are separate successors.