[bug] a caller fails its child when a status read blips #1251

Closed
opened 2026-10-27 13:39:38 +00:00 by sam · 0 comments
Owner

awaitCallee (internal/domain/workflow/workflow_call.go) fails the parent stage on the first CallStatus error, even when the callee is still running. A briefly unavailable State Store -- a restart, a transport blip -- therefore kills a wait:true call whose child would have finished.

Design

Classify the read error, not the whole wait. storecontract gains ErrUnavailable, derived by staterpc's unmapError from the Unavailable gRPC code (wrapping both, so status-code readers still see it). awaitCallee retries a read that is ErrUnavailable or context.DeadlineExceeded with doubling backoff capped at callReadMaxBackoff, inside the caller's own context, and fails at once on a contract error (ErrCallNotYours, ErrCallCallerNotRunning). The child is never re-started: the call keeps the callee id it already has, so recovery starts no second child.

Acceptance criteria

Tests pin: two refused reads then an answer still yields the callee's outputs; ErrCallNotYours fails on the first read; an outage outlasting the caller's deadline returns the deadline; and a whole wait:true call step retries a refused read, starts exactly one child and closes one call step.

Close reason

Verified: fixed in code or doc/file no longer exists (see burndown 2026-10-13)


Imported from beads archie-core-bsk2 · GitHub #1549 · type bug · priority P2 · created 2026-10-08 · closed 2026-10-12

awaitCallee (internal/domain/workflow/workflow_call.go) fails the parent stage on the first CallStatus error, even when the callee is still running. A briefly unavailable State Store -- a restart, a transport blip -- therefore kills a wait:true call whose child would have finished. ### Design Classify the read error, not the whole wait. storecontract gains ErrUnavailable, derived by staterpc's unmapError from the Unavailable gRPC code (wrapping both, so status-code readers still see it). awaitCallee retries a read that is ErrUnavailable or context.DeadlineExceeded with doubling backoff capped at callReadMaxBackoff, inside the caller's own context, and fails at once on a contract error (ErrCallNotYours, ErrCallCallerNotRunning). The child is never re-started: the call keeps the callee id it already has, so recovery starts no second child. ### Acceptance criteria Tests pin: two refused reads then an answer still yields the callee's outputs; ErrCallNotYours fails on the first read; an outage outlasting the caller's deadline returns the deadline; and a whole wait:true call step retries a refused read, starts exactly one child and closes one call step. ### Close reason Verified: fixed in code or doc/file no longer exists (see burndown 2026-10-13) --- _Imported from beads `archie-core-bsk2` · GitHub #1549 · type bug · priority P2 · created 2026-10-08 · closed 2026-10-12_
sam added the mediumbug labels 2026-10-27 13:39:38 +00:00
sam self-assigned this 2026-10-27 13:39:38 +00:00
sam closed this issue 2026-10-27 13:39:38 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1251