fix: check process start for stdin-less commands so the Executor queue can't stall#1606
Conversation
…tall Executor::executeNext() only ran waitForStarted() for commands that carry stdin. A command WITHOUT stdin (most git/gpg/pass invocations) that failed to start emitted QProcess::errorOccurred(FailedToStart) but never finished(), so the finished handler that clears `running` and advances the queue never ran — `running` stayed true forever and the entire FIFO queue stalled, freezing all further password-store operations with no feedback. Run the start check for every command regardless of stdin: on failure, emit an error (deferred via a queued call, as before), dequeue, clear `running`, and continue with the next item. The stdin-write path is unchanged. Adds tst_executor::executeAsyncFailedToStartNoInputDoesNotStall, which queues a failing no-input command followed by a valid one and asserts the error is surfaced and the second command still completes (the queue did not stall). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JuQsrHonihp1nARE7bzstc
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughRefactors ChangesExecutor Queue Stall Fix
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1606 +/- ##
==========================================
- Coverage 52.98% 52.97% -0.02%
==========================================
Files 52 52
Lines 4371 4370 -1
==========================================
- Hits 2316 2315 -1
Misses 2055 2055
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Summary
From the full
src/review — a HIGH-severity queue stall inExecutor.The bug
Executor::executeNext()only calledwaitForStarted()for commands that carry stdin input:A command without stdin — which is most
git/gpg/passinvocations — that fails to start (missing binary, bad path, permissions) emitsQProcess::errorOccurred(FailedToStart)but neverfinished(). The Executor advances its FIFO queue from thefinishedhandler (which clearsrunning), so that handler never ran:runningstayedtrueforever and the entire queue stalled, freezing all subsequent password-store operations with no user feedback.(The stdin case was already handled — see #1598.)
The fix
Run the start check for every command regardless of stdin. On failure, emit an error (deferred via a queued call so we don't re-enter a caller still on the stack), dequeue, clear
running, and continue to the next item. The stdin-write path is unchanged.Test
tst_executor::executeAsyncFailedToStartNoInputDoesNotStallqueues a failing no-input command followed by a valid one and asserts the error is surfaced and the second command still completes. Verified to fail without the fix (the second command never runs — the queue stalls until the test times out).Full executor suite (35) and integration suite (22) pass; zero doxygen warnings.
🤖 Generated with Claude Code
Summary by CodeRabbit