fix(scheduler): remove wait_idle from startup path#153
Merged
Conversation
wait_idle() blocks until all pending saves complete, which can cause handshake timeout on --resume when cron normalization triggers disk I/O. The tick loop only needs the in-memory task set to be correct (which switch_session guarantees synchronously). Disk sync is fire-and-forget with dirty-flag retry on failure. Added warning doc to wait_idle() clarifying it's for tests/tooling only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wait_idle()call from session startup path that was blocking handshake on--resumewait_idle()clarifying it's for tests/tooling onlyChanges
crates/loopal-agent-server/src/session_start.rs: Remove blockingwait_idle()callcrates/loopal-scheduler/src/scheduler.rs: Add warning doc towait_idle()Root Cause
wait_idle()blocks until all pending saves complete. On--resume, cron normalization triggers disk I/O via the save worker. If the save is slow,wait_idle()blocks the startup path, causing the 30s handshake timeout.The tick loop only needs the in-memory task set to be correct (which
switch_sessionguarantees synchronously). Disk sync is fire-and-forget with dirty-flag retry on failure.Test plan