fix(daemon): defer hot-reload drain until in-flight runs complete #135
Reference in New Issue
Block a user
Delete Branch "fix/134-hot-reload-in-flight"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Defer file-watcher hot-reload drain+respawn until all in-flight workflow runs complete, instead of immediately killing active threads.
Why
When workflow-generator modifies another workflow's source while it's running, the daemon's file watcher immediately drains the worker, interrupting the active run (~50% failure rate). (#134)
Changes
drainWhenIdle()withpendingDrainstracking; wiremaybeDeferredHotReloadDraininto thread-event and workflow-error completion paths; clean up on crash and stop()drainWhenIdleinstead ofdrainAndRespawnRef
Fixes #134
LGTM ✅ 逻辑清晰,完成路径全覆盖,测试扎实。