fix(bash_job_notify): do not treat JOB_NOT_FOUND as terminal failed - #23
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix(bash_job_notify): do not treat JOB_NOT_FOUND as terminal failed#23cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
Worker restart or daemon restart can drop in-memory job registries while OS processes still run. Keep polling instead of injecting a false failure notification and removing tracking. Co-authored-by: Yuxuan Liu <Osc-7@users.noreply.github.com>
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.
Bug and impact
When a remote worker restarts (upgrade/crash) or the daemon restarts, the in-memory job registry is lost while OS processes may still be running. The bash job notify watcher mapped
JOB_NOT_FOUND(and localJobManagermisses) to terminal statusfailed, injected a false completion notification, and removed the job from tracking.This misleads the agent/user into believing a long-running background job failed when it may still be executing.
Root cause
_query_job_status()inbash_job_notify.pytreated registry lookup failures as terminalfailedstatus instead of an unknown/transient state.Fix
Return
Nonefrom_query_job_status()onJOB_NOT_FOUNDor missing local handle sopoll_terminal_jobs()keeps polling and does not emit a false failure notification.Validation
JOB_NOT_FOUNDand local missing handle scenariospytest tests/test_bash_job_notify.py— 5 passed