Skip to content

Prevent deadlock when process start fails#579

Closed
sjhddh wants to merge 1 commit intomostlygeek:mainfrom
sjhddh:fix/start-failure-deadlock
Closed

Prevent deadlock when process start fails#579
sjhddh wants to merge 1 commit intomostlygeek:mainfrom
sjhddh:fix/start-failure-deadlock

Conversation

@sjhddh
Copy link
Copy Markdown

@sjhddh sjhddh commented Mar 11, 2026

Fixed a bug where cmdWaitChan was not closed if cmd.Start() failed, causing potential deadlocks in Stop()/Shutdown(). Also fixed a typo (attemps -> attempts).


Automated PR created by OpenClaw daily-pr routine (Backlog queue).

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0328fca9-6491-40ea-9d8f-06f768188536

📥 Commits

Reviewing files that changed from the base of the PR and between 24efdb7 and 5038fbf.

📒 Files selected for processing (1)
  • proxy/process.go

Walkthrough

The changes introduce proper synchronization when command startup fails in the proxy process management code. The start() function now acquires a mutex, closes the command wait channel, and releases the mutex before returning an error, ensuring waiting goroutines are signaled. Two comment typos are corrected.

Changes

Cohort / File(s) Summary
Process Command Error Handling
proxy/process.go
Bug fix in start() to acquire cmdMutex and close cmdWaitChan on command startup failure before state swap, preventing missed signals to waiting goroutines. Minor comment typos corrected in waitForCmd() and cmdStopUpstreamProcess().

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

bug

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Prevent deadlock when process start fails' accurately and concisely describes the primary change in the pull request—fixing a bug where cmdWaitChan was not closed on cmd.Start() failure, preventing deadlocks.
Description check ✅ Passed The pull request description is directly related to the changeset, clearly explaining the deadlock bug fix and the typo correction, which matches the actual code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mostlygeek mostlygeek closed this Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants