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

[Bug]: process.exit does return and is not exiting synchronously when called in async function #41866

Closed
3 tasks done
IIIMADDINIII opened this issue Apr 15, 2024 · 4 comments
Closed
3 tasks done
Labels
bug 🪲 has-repro-gist Issue can be reproduced with code at https://gist.github.com/ status/wontfix 🚫

Comments

@IIIMADDINIII
Copy link

Preflight Checklist

Electron Version

29.3.0

What operating system are you using?

Windows

Operating System Version

Windows 10 Pro 22H2

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

When i run electron with the following code, it should not log test to the console:

const { setTimeout } = require("timers/promises");

async function main() {
  await setTimeout(100);
  process.exit();
  console.log("test");
}

main()

Actual Behavior

test is logged to the console.
So process.exit() doeas return wenn called in an async function after an await.
The same code un in node will not log test.

Testcase Gist URL

https://gist.github.com/61fb0bb05e0da37bb1b2da6ff78baacc

Additional Information

No response

@electron-issue-triage electron-issue-triage bot added the has-repro-gist Issue can be reproduced with code at https://gist.github.com/ label Apr 15, 2024
@codebytere
Copy link
Member

@IIIMADDINIII see #32831 - this has been tried before and is unfortunately a pretty tricky problem!

@IIIMADDINIII
Copy link
Author

Interestingly i can not reproduce the mentioned issue #32060 in #32831 with the provided Gist (https://gist.github.com/RaisinTen/ced9932fd0d76dd30ec72758bc18bc51) in Electron Fiddle and Electron v28.3.0.

I will try the Solution of the Pull Request #32831 locally.

@georgexu99
Copy link
Contributor

Adding a status/won't fix, see above comments 🙇 The current proposed solution involves a breaking change that will likely cause more problems than it fixes (#32831).

@codebytere
Copy link
Member

Closing in agreement with above.

@codebytere codebytere closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 has-repro-gist Issue can be reproduced with code at https://gist.github.com/ status/wontfix 🚫
Projects
None yet
Development

No branches or pull requests

3 participants