Repository navigation
fix(runner): retain fast ComfyUI completions across startup - #113
Merged
Merged
Conversation
Goal: release a completed session even when its first history read is unavailable or follows a fast job. How: capture the session boundary before starting the child and exclude terminal records from that grant from both initial and recovered history baselines. Key details: preserve lifetime and undated history, reject future timestamps, and keep busy queues protected. Cover startup refusals, immediate history, successful/error/interrupted jobs, prior or unknown records, and busy queues.
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.
Problem
An
exit_comfyui_idlesession can keep its lease after a fast first job has already finished. If the initial history read fails during server startup, the first successful read can absorb the completed job into the baseline. The same problem occurs when that job finishes before the detector's first history snapshot. The queue can remain empty throughout, so no observed busy-to-idle transition rescues the session.Change
execution_success,execution_errorandexecution_interrupted.This uses the existing bounded history API and shared drain path. It adds no configuration or dependencies and changes no ordinary daemon-requested drain or parking policy.
Regression coverage
TestComfySessionRecoversCompletedJobFromUnavailableBaselinereproduces startup history refusal, completion before the first successful history read, failed/interrupted jobs, prior/future/undated history, a nonterminal event and a busy queue.The test fails on upstream
75c0b708cc6e7186ddc39be19da60f2b16ad4fa4in the four terminal startup cases before the production patch is applied. The unchanged regression passes with this patch, including repeated execution.Validation
The committed contribution passes:
The focused regression also passes with
-count=3. The tests use a shortTMPDIRto stay within Unix socket pathname limits. Review and secret scanning cover the complete introduced commit, metadata, exported patch and this PR body; the exported patch replays to the exact committed tree.Current-base verification is CPU-only. Windows validation here is cross-build/vet; native Windows execution belongs to CI. This PR does not claim GPU/image-model quality or a clean full host-acceptance campaign.
Follow-up to #87.