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

NodeJS processes hanging after application force close #57

Open
mightyt73 opened this issue May 15, 2023 · 2 comments
Open

NodeJS processes hanging after application force close #57

mightyt73 opened this issue May 15, 2023 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@mightyt73
Copy link

Hello! I am having an issue with a packaged Steam application where I use NodeJs-Unreal. When a user closes the application incorrectly (alt-f4, force close, task manager, etc) it seems the currently running NodeJS processes are moved to the Background Processes in task manager. Steam detects that these are still part of the game execution and causes the Steam client to continue to say that the game is running.

When the user clicks my 'Exit' button, I use a script to kill all the NodeJS processes related to the application so this issue does not occur then.

I don't know if this is an issue or a feature, but it would be nice to be able for those processes to close automatically somehow. I am not super familiar with all of it so my suggestions are probably little value, but a timeout of some sort, or a way to detect that the main process force closed. Or maybe I am doing something incorrectly.

Thank you for all your work so far this code has been great to use!

@getnamo getnamo added enhancement New feature or request help wanted Extra attention is needed labels May 15, 2023
@getnamo
Copy link
Owner

getnamo commented May 15, 2023

A timeout seems like a reasonable way to go. We can have a heartbeat from unreal e.g. every 10-30sec and if it doesn't receive it, exit the process.

Likely can be modified in the nodewrapper.js https://github.com/getnamo/NodeJs-Unreal/blob/master/Content/Scripts/nodeWrapper.js and an event listener with echo callback on runmainscript https://github.com/getnamo/NodeJs-Unreal/blob/master/Source/CommandLine/Private/NodeCmd.cpp#LL139C1, if echo not received within timeout interval, call gracefulexit.

I probably won't have time in the near term to add this, but this should be enough info for anyone to make a patch and open a pull request for the feature; I'll merge it then.

Cool to hear about an actual use case of the plugin in the wild, wishing the best for your project.

@mightyt73
Copy link
Author

I will try my best at it! Thank you so much for the direction.

@mightyt73 mightyt73 reopened this May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants