-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
[Bug]: Spawning and unreferencing a child process prevents electron from exiting #34808
Comments
I've noticed this in the past as well. Some processes don't exit:
while these exit immediately (if you wrap
|
Well, I just had a deja vu and I commented the exact same thing a year ago 😄 #24520 (comment)
Back then what I meant with "normal unix behavior" is that the |
When using electron-updater on Linux with the AppImage target, this can cause a significant amount of lingering processes on long-running hosts that apply multiple updates |
Just started writing e2e tests and now this becomes a real problem. The tests will time out because Electron never exits. Even this is not enough:
As long as the child process does not exit, playwrights |
I've tried electron 20-x-y and the 21 alpha, just in case there was any change, without success. |
I am seeing the exact same behavior, I have a Basically I created a function that calls the "app.close/process.exit" message, but ALSO kills all processes associated with the parent if a
|
The issue is that Chrome/Electron leaks open file-descriptors into the child-process. For one reason or another, these open file-descriptors being held by the child-process are keeping parts of Electron from exiting until they are closed. Try looking at the One way around this is to loop over all the open file-descriptors that your child-process has inherited and close them all. (of course it would be better if Electron were to provide this functionality in the Below is a wrapper which accomplishes this with some bash magic:
|
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
Still repros with 22.0.1 and 23.0.0-beta.1. After the main process exits, these three processes will stay until the child has exited:
|
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
This issue still affects the latest Electron, I'm now using the workaround here #34808 (comment) by p120ph37 |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
Anyway we can turn off the "Stale" bot on this issue? This issue still affects the latest Electron, I'm still using the workaround here #34808 (comment) by p120ph37 |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
Anyway we can turn off the "Stale" bot on this issue? This issue still affects the latest Electron, I'm still using the workaround here #34808 (comment) by p120ph37 |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
Anyway we can turn off the "Stale" bot on this issue? This issue still affects the latest Electron, I'm still using the workaround here #34808 (comment) by p120ph37 |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
Anyway we can turn off the "Stale" bot on this issue? This issue still affects the latest Electron, I'm still using the workaround here #34808 (comment) by p120ph37 |
I received the following similar error "white screen" when running I build my applications with GTK 4 (C/C++) in parallel with a nice UI named Cambalache. Electron Version: electron29-29.3.1-1 So many npm/nodejs monsters nowadays. Anyone have any recommendations for a client built with non-js 💩 ? JS is a security nightmare to begin with and am humored by all the js being used for secure messaging app..electron is a bloated piece of yuk imo and should rarely be used for a professional application. A fresh init of element-desktop with electron-29 💩
|
Seem as this ElectronJS inter process communication and usage of contextBridge to Create a safe, bi-directional, synchronous bridge across isolated contexts source: PR from itch.io |
related Electron issue on NoNewPrivs is set |
From Electron Project progress on version 31 like fix for Crash when adding child view seems that some IPC fixes for communication on Electron process model are on the way to Electron and Chromium but some bugs like unresponsivness of sleeping process still present which may be related to this whole mess. |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
Anyway we can turn off the "Stale" bot on this issue? This issue still affects the latest Electron, I'm still using the workaround here #34808 (comment) by p120ph37 |
Preflight Checklist
Electron Version
19.0.7
What operating system are you using?
Other Linux
Operating System Version
Debian 10 (buster)
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
No response
Expected Behavior
Running the following:
should allow Electron to exit without waiting for the child process.
Actual Behavior
Electron emits the correct events, however some electron processes linger until the child process has completed.
Testcase Gist URL
https://gist.github.com/Josh-G/aadee165b50c7629d5f1c9340728a8ca
Additional Information
I've also created a repo with a workflow that demonstrates the issue; https://github.com/Josh-G/electron-spawn-detached
I believe this may be the same as, or a regression of, #2208 #13870.
I've reproduced this on Linux on arm64 + x64 with Debian and Ubuntu (thru GitHub Action).
The text was updated successfully, but these errors were encountered: