Repository navigation
LS-56: skip settled task refreshes and unchanged scheduler saves - #27
Merged
Merged
Conversation
Co-authored-by: multica-agent <github@multica.ai>
Co-authored-by: multica-agent <github@multica.ai>
Co-authored-by: multica-agent <github@multica.ai>
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.
The scheduler rereads execution files and saves every historical task each cycle. Skip routine refreshes for settled terminal tasks while retaining checks for blocked tasks, ambiguous submissions, execution_unknown and pending stops. Save task snapshots only when their content changes, and remove the unused sync fingerprints and changed-task payload. Settled stop markers are no longer rewritten each cycle.
Before settling an exited job, reread the runner status after observing the job exit or resource closure. Before confirming a stop, refresh after observing matching exit proof. This preserves natural completion, final step outputs and logs when the runner finishes after the cycle's first status read.
Persist terminal reconciliation in the task snapshot. On upgrade, dispatched failed, stopped or interrupted records without this marker receive a result check before becoming idle. Reopening the database and restarting the service preserve the check. Old records lacking exit evidence continue reconciliation; completed and unstarted cancelled records remain idle.
Changes are limited to gpuqueue/service.py and tests/test_gpuqueue.py. Twelve new regression tests cover zero verified historical reads and saves, active log updates, unchanged cycle syncs, version-bound approvals, late receipts, matching stop proofs, shutdown races, legacy terminal recovery and durable checks across restarts. The runtime race and upgrade recovery tests reproduce incorrect stopped/failed results before their respective fixes.
Validation: all 158 Python unit tests passed with unittest discovery. The sandbox makes HOME/scratch read-only, so a test-only tempfile redirect sends those fixtures into the writable workspace; HOME and product behavior are unchanged. git diff --check passed. No live GPU, Feishu account or macOS WebKit verification was performed.
CI limitation: the existing inspire-queue-review-baseline fails before running tests because its required release commit b9e2c3e is not an ancestor of the main base af51af5 or this task branch. The failure already exists on the original PR head (run 45577553748). Workflow changes are outside this issue's authorized scope.
Target branch: main. Another issue also edits refresh_task; whichever PR merges later may need rebasing.
Closes LS-56