-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal Code
-
None
-
Fully Compatible
-
v4.4
-
Service arch 2020-11-30
-
28
Investigating SERVER-51821, I found an ASSERT_EQ in a worker thread, which, if triggered, would crash the process with std::terminate. It is not valid to perform any kind of ASSERT from unit test thread other than the main thread.
This cause of std::terminate is NOT ultimately the symptom of SERVER-51821, in which the controlling thread simply stopped (via throw) and never executed the explicit .join of the worker threads at the bottom of the test. But investigation of SERVER-51821 uncovered the ASSERT from non-main problem to be a very common weakness that exists in most of our concurrent unit tests.
I propose that we identify ASSERTs that need to be fixed by changing ASSERT so that even if it passes, it will fail unless it is running on a safe thread.
- is depended on by
-
SERVER-51821 Always join threads in SharedFuture tests
- Closed
- is related to
-
SERVER-53049 stdx::condition invariants and segfaults in unittest framework
- Closed
- related to
-
SERVER-54531 All ASSERTs should fail hard if they're on an unsafe thread
- Closed
-
SERVER-53065 std::terminate handler must learn to print ASSERT failures
- Closed