-
-
Notifications
You must be signed in to change notification settings - Fork 356
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
CPU overload due to wrapper launching new Node processes when an unhandled error occurs #375
Comments
@coreybutler is there a way to handle these types of errors properly? For the sake of our port scan tests, I've added this snippet for a work-around |
@jkomoda something seems off here. The wrapper won't relaunch the child process unless it exits. Even when it does, there is exponential backoff. This looks suspiciously like the server is being closed when the client disconnects or when an error occurs, but the process isn't exiting when the server closes (which it should). That would be part of the application code. I'm not entirely clear on the environment this is operating in, but I'd try running without node-windows to compare. Ultimately, it seems like the errors should be handled in the app though. The uncaughtException is just a failsafe. |
@coreybutler thanks for the reply. One important thing I left out was that the process runs fine in the console (non node-windows). It doesn't crash we don't seem to be getting any I see this PR - https://github.com/coreybutler/node-windows/pull/277/files which seems similar to our case. Can you elaborate on these changes? |
@coreybutler I have tested the code changes in the PR and it now seems to be working fine. So basically we are leaking the 'ghost' servers and aren't closing the previous one before creating another one correct? Is it possible to merge that and create a new release so we're able to use it? |
Honest truth, I completely forgot about that PR. My comments still stand... I don't want to flood the logs unnecessarily. Aside from that, I'm fine with merging that PR. If you want to apply the updates to that PR, I should be able to include them and cut a new release. Yes, I believe you are correct re: ghost servers. |
@coreybutler awesome! I've created a PR which adds an option to ignore warning logs when creating the daemon service - Add daemon option to suppress warning logs #376 I wanted to add it to the existing PR - Prevent security scanner from killing wrapper with ECONNRESET #277 but I have no access to push to his branch, and not sure if/when he will be active. If you can merge both of these PRs, and create a new release that would much appreciated! Thanks! |
@coreybutler just checking up, is it possible to merge these PRs and cut the new release? |
@coreybutler any updates on this? |
Issue:
When running port scans on nodejs apps running via node-windows, the server CPU and memory is being overloaded to 100% due to node-windows continuously launching new processes when receiving the error:
The scanner client connects to server, sends TCP packet data, then disconnects. Each time the disconnect happens, the wrapper catches this error and launches a new process here:
node-windows/lib/wrapper.js
Line 205 in 27779d9
How To Reproduce:
Expected Behavior:
The wrapper to handle the
ECONNRESET
error gracefully and not launch more processes without killing the previous oneScreenshots:
read ECONNRESET
error being logged fromwrapper.js
The text was updated successfully, but these errors were encountered: