[SERVER-51821] Always join threads in SharedFuture tests Created: 23/Oct/20  Updated: 29/Oct/23  Resolved: 24/Nov/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Amirsaman Memaripour Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: servicearch-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-53035 provide a way to ASSERT from a non-ma... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service arch 2020-11-30
Participants:
Linked BF Score: 23

 Description   

Some of the unit-tests for SharedFuture (e.g., ConcurrentTest_ManySharedFutures) create a number of worker threads to test the behavior of futures in presence of concurrency. An attempt to delete these threads before they are joined (e.g., due to an exception) would cause the termination of the unit-test process (i.e., invocation of std::terminate).

To prevent the termination and ensure the real cause of failure remains always visible, we must ensure all worker threads are joined before they go out-of-scope.



 Comments   
Comment by Billy Donahue [ 24/Nov/20 ]

Fixed by same commit as SERVER-53035

Comment by Billy Donahue [ 24/Nov/20 ]

This fix is going to draft on SERVER-53035, since it is built on top of those changes in the structure of these tests.

Comment by Billy Donahue [ 19/Nov/20 ]

It's not really supported to ASSERT_EQ from a unit test thread other than the main thread.
If the ASSERT fails the test will bomb. We'll have to get a little fancy to hand the assertion result back to the main thread and stop the worker that threw it.

Generated at Thu Feb 08 05:26:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.