fix(core): resolve daemon client reconnect queue deadlock#34284
Merged
FrozenPandaz merged 1 commit intomasterfrom Feb 2, 2026
Merged
fix(core): resolve daemon client reconnect queue deadlock#34284FrozenPandaz merged 1 commit intomasterfrom
FrozenPandaz merged 1 commit intomasterfrom
Conversation
When a request is retried after daemon dies, the retry was being added back to the promise queue while the original request was still blocked waiting for a response that would never come. This caused a deadlock where the retry couldn't execute until the original completed. Fix by directly calling sendMessageToDaemon instead of going through the queue, which resolves the pending promise the original queue entry is waiting on, allowing it to complete naturally.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
View your CI Pipeline Execution ↗ for commit 71be832
☁️ Nx Cloud last updated this comment at |
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
MaxKless
approved these changes
Feb 2, 2026
FrozenPandaz
added a commit
that referenced
this pull request
Feb 3, 2026
## Current Behavior When the daemon dies while processing a request, the reconnect logic adds the retry back to the promise-based queue. However, the original request is still blocked in the queue waiting for a response that will never come (the socket is dead). This creates a deadlock: 1. Original request (`fn1`) is blocked awaiting a promise that will never resolve 2. Retry request (`fn2`) is queued but can't execute until `fn1` completes 3. `fn1` can't complete because it's waiting on the dead socket ## Expected Behavior When reconnecting after daemon death, the retry should resolve the pending promise that the original queue entry is waiting on, allowing the queue to proceed normally. ## Related Issue(s) <!-- No specific issue, discovered during development --> ## Solution Instead of re-queuing the retry through `sendToDaemonViaQueue` (which adds to the end of the queue), we now call `sendMessageToDaemon` directly. This resolves the pending promise that `fn1` is waiting on, allowing it to complete naturally and the queue to proceed. Also removed the now-unused `decrementQueueCounter` method from `PromisedBasedQueue`. (cherry picked from commit 89aa25e)
Contributor
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Current Behavior
When the daemon dies while processing a request, the reconnect logic adds the retry back to the promise-based queue. However, the original request is still blocked in the queue waiting for a response that will never come (the socket is dead). This creates a deadlock:
fn1) is blocked awaiting a promise that will never resolvefn2) is queued but can't execute untilfn1completesfn1can't complete because it's waiting on the dead socketExpected Behavior
When reconnecting after daemon death, the retry should resolve the pending promise that the original queue entry is waiting on, allowing the queue to proceed normally.
Related Issue(s)
Solution
Instead of re-queuing the retry through
sendToDaemonViaQueue(which adds to the end of the queue), we now callsendMessageToDaemondirectly. This resolves the pending promise thatfn1is waiting on, allowing it to complete naturally and the queue to proceed.Also removed the now-unused
decrementQueueCountermethod fromPromisedBasedQueue.