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

fix: check if we are crashing before exiting gracefully #12865

Merged
merged 4 commits into from
Jul 27, 2024

Conversation

paperclover
Copy link
Member

What does this PR do?

While working on #12864 I hit a hilarious edge case:

image

We started crashing, but since the crash was on a bundler thread, the main thread was able to successfully terminate.

This makes our exit function check if we are terminating (one atomic load) and will instead sleep forever.

Additionally, I realized that sometimes bun would crash on a second thread while the first is crashing. This worked fine before with panics, but not segfaults.

This also removes Global.panic in favor of Output.panic

@Jarred-Sumner Jarred-Sumner merged commit 70ca2b7 into main Jul 27, 2024
50 of 54 checks passed
@Jarred-Sumner Jarred-Sumner deleted the dave/crash-handler-threadsafe-exit branch July 27, 2024 03:00
Copy link
Contributor

@paperdave, your commit has failing tests :(

🪟💻 2 failing tests Windows x64 baseline

  • test/cli/install/registry/bun-install-registry.test.ts 1 failing
  • test/js/node/child_process/child_process.test.ts 1 failing

🪟💻 2 failing tests Windows x64

  • test/cli/install/registry/bun-install-registry.test.ts 1 failing
  • test/js/node/child_process/child_process.test.ts 1 failing

View logs

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

Successfully merging this pull request may close these issues.

2 participants