Skip to content
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

Each service is creating 2 seperate node processes #374

Open
mdodge-ecgrow opened this issue Mar 20, 2024 · 4 comments
Open

Each service is creating 2 seperate node processes #374

mdodge-ecgrow opened this issue Mar 20, 2024 · 4 comments

Comments

@mdodge-ecgrow
Copy link

I don't really know if this is a bug, or something that is expected behavior. But it seems odd to me.

I have 2 seperate windows services for our Production Node server doing two seperate things. When I start them up, I noticed there are actually 2 processes that start for each service. One on the port I am telling it, and one a seemingly random high port. I even started a third service for our test environment, and noticed 2 more processes start up. I have this Powershell command that spits out all processes and details about them with a given name.
Get-NetTCPConnection | Where-Object { $_.State -eq "LISTEN" } | select @{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}},owningprocess, localaddress, localport, creationtime | where Process -eq "node" | Format-Table -AutoSize

So when I run that with my two services started, I get this:
image

I should add that we did have "auto-recovery" turned on for those Node services earlier today when I was having these issues. But I have since disabled that on all of our Node windows services.

@mdodge-ecgrow
Copy link
Author

And here is another related question. When I go under task manager, this is what I see:
image

I would love to start killing those off, but we have production running right now and I just broke produciton earlier when I was playing with the Node processes. I'll have to have a look at this after a fresh reboot to see how it compares.

@mdodge-ecgrow
Copy link
Author

So after looking closer, I see that am able to match up the PID's in the bottom 4 tasks to the ones in the previous screenshot. So, that tells me I should be able to kill all the other tasks. Maybe i'll try it when production goes on break.

@mdodge-ecgrow
Copy link
Author

mdodge-ecgrow commented Mar 20, 2024

Adding an update to this. The whole reason I went down this rabbit hole was I was doing a bunch of testing in our test environment. The process would look like this, I would stop the Node service from Services.msc, modify some code in the Node server and save the file, restart the Node service, perform my test. And then do it all over again. (Yes, I realize not the ideal way to develop and test.) But after a while I would stop the Node service and then I would find out it was still processing my file, meaning there was a still a Node service running somewhere.

So anyways, Production took their lunch break and I killed all the other Node tasks except those 4 with the matching PID. Then I tested the file processing and now it is not processing that file just like I would expect. So I'm not sure how we got all those rogue Node tasks running, but glad I got if figured out for now. And at least now I know how to fix it without crashing the Production Node server.

But if anyone has any thoughts about why this is happening, I'd love to hear it. And if you need any more info from me, let me know.
Thanks!

@mdodge-ecgrow
Copy link
Author

I was just reading through this thread: #235
I'm not sure if that is the same or different issue as mine. But I do know I am still having rogue Node processes running that I would not like to be and are causing issues.

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

No branches or pull requests

1 participant