Skip to content

fix(loop): preserve domain-gated readiness#21

Merged
jaredjakacky merged 1 commit into
mainfrom
fix/loop-auto-ready-ordering
May 19, 2026
Merged

fix(loop): preserve domain-gated readiness#21
jaredjakacky merged 1 commit into
mainfrom
fix/loop-auto-ready-ordering

Conversation

@jaredjakacky
Copy link
Copy Markdown
Owner

Summary

Fixes LoopWorker readiness ordering when auto-ready is disabled.

  • Records the initial not-ready state before launching the loop goroutine
  • Prevents a loop's SetReady(true) call from being overwritten by startup bookkeeping
  • Adds a deterministic regression test for the startup ordering

Why

With WithLoopAutoReady(false), readiness is owned by the loop. The loop should be able to call WorkerRuntime.SetReady(true) after domain warmup and have that signal stick.

The previous startup order launched the loop goroutine before calling SetReady(false). Under race-mode scheduling, the loop could mark itself ready first, then Start could overwrite readiness back to false.

Verification

  • make test
  • make test-race

@jaredjakacky jaredjakacky merged commit 2dbeffd into main May 19, 2026
7 checks passed
@jaredjakacky jaredjakacky deleted the fix/loop-auto-ready-ordering branch May 19, 2026 16:50
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