Don't false-block tasks when a tmux status check transiently fails#558
Open
kylecarbonneau wants to merge 1 commit into
Open
Don't false-block tasks when a tmux status check transiently fails#558kylecarbonneau wants to merge 1 commit into
kylecarbonneau wants to merge 1 commit into
Conversation
pollTmuxSession treated a single failed 'tmux list-panes' as 'window gone'
and marked the task blocked ('Task needs review'). That command also fails
when the tmux server is briefly busy or the 3s timeout trips under load;
because every concurrent poller shares one tmux server, a momentary stall
made them all misfire at once — a false, simultaneous mass-block of healthy
running tasks regardless of permission mode.
Require missingThreshold (3) consecutive failed checks before concluding the
window is gone, and reset the counter on any successful check.
85e514a to
213336a
Compare
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
pollTmuxSessionmarks a task blocked ("Task needs review") the moment a singletmux list-panescheck fails. But that command also fails transiently — when the tmux server is briefly busy, or its 3s timeout trips under load. Because every running task's poller hits the same tmux server, a momentary stall makes them all misfire at once, false-blocking healthy, actively-running tasks simultaneously (regardless of permission mode).Fix
Require
missingThreshold(3) consecutive failed window checks before concluding the window is gone, and reset the counter on any successful check. A transient blip can no longer false-block a healthy task; a genuinely-closed window is still detected (~3s later).Testing
go build ./...andgo vet ./...clean;go test ./internal/executor/...passes. No behavior change for the legitimate "window really closed" path — same final-status resolution, just gated behind the consecutive-miss threshold.