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

Prevent double panic in the Drop of TaksPoolInner #1064

Merged
merged 1 commit into from
Dec 22, 2020

Conversation

refnil
Copy link
Contributor

@refnil refnil commented Dec 14, 2020

TaskPoolInner would cause failing bevy test (see #1057) to abort the running test suite immediately.

Here is the problematic situation as I understand it:

  • The Drop of TaskPoolInner is called on a panicking thread. (I guess that happen when rust is unwinding from a panic)
  • The Drop then try to join on all of his threads. However, at least one of them finish with a panic and return an error on the join call.
  • except panic when receiving an error.
  • Panic in panic happens and everyone is sad (I think?). I'm new to rust so I may be wrong here.
  • The program abort.

My idea is to only panic when the current thread is not already panicking.

@Moxinilian Moxinilian added A-Build-System Related to build systems or continuous integration A-Core Common functionality for all bevy apps P-Crash A sudden unexpected crash labels Dec 15, 2020
@cart
Copy link
Member

cart commented Dec 22, 2020

This makes sense to me. Good call!

@cart cart merged commit 906b406 into bevyengine:master Dec 22, 2020
@fopsdev fopsdev mentioned this pull request Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Build-System Related to build systems or continuous integration A-Core Common functionality for all bevy apps P-Crash A sudden unexpected crash
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants