You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8c60640
Browse filesBrowse the repository at this point in the historyBrowse files
`processNewPendingTask` and `processTaskExecutionStarting` enqueued the
execution request inside their DB transaction. The assumption that no worker
could dequeue it before the commit is wrong: integration testing showed the
receiver picking up the message and processing an execution instance whose row
was not yet committed. Both now capture the poke as post-commit intent and send
after the transaction closes, mirroring `workflow`'s state-before-poke rule
(workflow/DESIGN.md Invariant 8). The sender lookup stays inside the
transaction so a task with no route to a worker still rolls back.
That inverts the failure mode - a lost poke now strands a committed ENQUEUED
instance - so two backstops come with it:
- `repokeEnqueuedExecution` plus a maintenance sweep step that re-sends (and
mutates nothing) for instances ENQUEUED past a grace period of one
maintenance interval. Needs the new `UpdatedBefore` query filter.
- The receiver now reads an instance's state before claiming it and drops a
duplicate request for one already at or past ACQUIRED. Previously this failed
ValidNextState and was reported as ENGINE_FAILED, failing the whole parent
task - a latent hazard independent of this change.
Also stamps GORM's `created_at`/`updated_at` in UTC (`NowFunc`), which the rest
of the schema already used. Left as local time, `UpdatedBefore` would be off by
the host's UTC offset.
0 commit comments