-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(core): connections to daemon from plugin workers should not keep daemon alive #29540
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
View your CI Pipeline Execution ↗ for commit ec939fb.
☁️ Nx Cloud last updated this comment at |
@@ -122,6 +123,8 @@ export class DaemonClient { | |||
private _out: FileHandle = null; | |||
private _err: FileHandle = null; | |||
|
|||
private firstMessageSent = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unused.
@@ -153,7 +158,9 @@ const server = createServer(async (socket) => { | |||
}); | |||
|
|||
socket.on('close', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this only gets called when the client is destroyed?
The client won't be destroyed in the plugin worker right? Does this actually do anything at the moment?
Closing in favor of new strategy recommended by @FrozenPandaz |
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. |
Current Behavior
The daemon uses ref counts to shut down automatically when it is not being actively used. Plugin workers are started by the daemon and shut down automatically when the daemon shuts down. If one of these plugins communicates with the daemon, a reference is counted. This plugin worker will not shut down until the daemon shuts down, so its socket will not be closed... so the daemon will stay alive.
Expected Behavior
Connections to the daemon from a plugin worker do not track a reference. More generally, connections from any source can unref themselves.
Related Issue(s)
Fixes #