Loom will panic if the maximum number of branches is exceeded. If a
type's Drop impl performs a branch (for example, a MutexGuard or
Arc, or a user-defined type that performs atomic operations in its
Drop impl), we will hit the assertion a second time, resulting in a
double panic. This sucks, because it makes these test failures much
harder to debug.
This branch fixes the issue by changing the assertion checking path
length to also check if the current thread is panicking. If we're
already panicking, we don't make the assertion, to avoid causing a
double panic. I've added a test that reproduces this double panic, as
well.
I've also fixed a typo in the assertion message. :)
Loom will panic if the maximum number of branches is exceeded. If a type's
Drop
impl performs a branch (for example, aMutexGuard
orArc
, or a user-defined type that performs atomic operations in itsDrop
impl), we will hit the assertion a second time, resulting in a double panic. This sucks, because it makes these test failures much harder to debug.This branch fixes the issue by changing the assertion checking path length to also check if the current thread is panicking. If we're already panicking, we don't make the assertion, to avoid causing a double panic. I've added a test that reproduces this double panic, as well.
I've also fixed a typo in the assertion message. :)
Signed-off-by: Eliza Weisman eliza@buoyant.io