Skip to content

Retry transient read failures while polling the factory wrapper - #1133

Merged
pcapriolo-yc merged 3 commits into
qm-29-port-factory-loopfrom
factory-read-retry
Sep 12, 2026
Merged

Retry transient read failures while polling the factory wrapper#1133
pcapriolo-yc merged 3 commits into
qm-29-port-factory-loopfrom
factory-read-retry

Conversation

@pcapriolo-yc

Copy link
Copy Markdown
Contributor

Why

runFactoryProcess polls the wrapper through sandbox.readProcess, which the exec-based process session implements as one run call with a waitMs + 20s timeout. On the local backend that is an AbortSignal.timeout on a single HTTP call. During QM-1 attempt 7 the container was saturated by the full test suite in the second Review pass, one poll exceeded the timeout, the error propagated out of the work stage, the loop parked the item with The operation was aborted due to timeout, and sent TERM to a wrapper that had already passed Verify and Review after 3 hours 48 minutes.

What

  • Retry up to FACTORY_READ_RETRIES (6) consecutive read failures with a FACTORY_READ_RETRY_MS (2 s) pause. A success resets the count.
  • A vanished process session (no such process session) is still fatal on the first read, through the existing processIsGone predicate.
  • readRetryMs joins readWaitMs and termGraceMs as a test-time override.

Tests

  • New: a transient failure is retried and the run completes with no signal.
  • New: a vanished process session is not retried.
  • Updated: the three tests that relied on a single throwing read now script a persistent failure of FACTORY_READ_RETRIES + 1 throws with readRetryMs: 0, and pin the same TERM-once and teardown-once behavior.
  • Mutation check: with FACTORY_READ_RETRIES = 0 the transient-failure test fails; reverted.

node --test on the process-work and effects files: 77 pass. tsc, eslint, prettier green.

Paul Capriolo added 3 commits September 11, 2026 17:34
The loop reads the wrapper's output through one sandbox exec call with a
25 second timeout. Under a saturated container one poll exceeded it, the
error propagated, the loop parked the item and killed a run that had
passed Verify and Review after 3 hours 48 minutes (QM-1 attempt 7).
runFactoryProcess now retries up to six consecutive read failures with a
two second pause. A vanished process session is still fatal at once.
The leak-check test scripted one throwing read, so with retries it slept
24 seconds and rejected with the fake's own guard error instead of the
scripted one. It now scripts a persistent failure with no pause. A new
test pins that a successful read resets the streak.
@pcapriolo-yc
pcapriolo-yc marked this pull request as ready for review September 12, 2026 00:54
@pcapriolo-yc
pcapriolo-yc merged commit 67b01f3 into qm-29-port-factory-loop Sep 12, 2026
16 checks passed
@pcapriolo-yc
pcapriolo-yc deleted the factory-read-retry branch September 12, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant