Merged
Conversation
fea96d9 to
efbc529
Compare
This patch fixes a deadlock that could occur if the shell blocks forever on startup. To fix, we only grab the global shells lock when looking for an existing session and then grab it again when we modify or examine the global shells table, but critically we are not holding the lock while spawning the shell for the new session. This prevents a shell that never finishes starting up from locking up the whole daemon by retaining ownership of the global shells table lock. See #342 for context.
efbc529 to
bdb3eee
Compare
maxhbooth
approved these changes
Apr 24, 2026
|
|
||
| // Even the most sluggish dotfile setup ought to be done within | ||
| // 90 seconds. | ||
| const SENTINEL_POLL_TIMEOUT: time::Duration = time::Duration::from_secs(90); |
There was a problem hiding this comment.
Maybe it could be worth mentioning this change in the commit, my first thought when I saw this after reading the title was that the solution was to add a timeout.
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.
Issue Link
This is a re-write of #342 to strip out some agent artifacts.
AI Policy Ack
Ack
Description
This patch fixes a deadlock that could occur if the shell blocks forever on startup. To fix, we only grab the global shells lock when looking for an existing session and then grab it again when we modify or examine the global shells table, but critically we are not holding the lock while spawning the shell for the new session.
This prevents a shell that never finishes starting up from locking up the whole daemon by retaining ownership of the global shells table lock.
I also added a timeout to the shell startup process, though this isn't really the core of the deadlock issue. It would have been nice to have and would have prevented perminant daemon lockup.
See #342 for context.