[SERVER-54531] All ASSERTs should fail hard if they're on an unsafe thread Created: 12/Feb/21  Updated: 06/Dec/22  Resolved: 09/Mar/21

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

Type: Bug Priority: Major - P3
Reporter: Billy Donahue Assignee: Backlog - Service Architecture
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-53035 provide a way to ASSERT from a non-ma... Closed
Assigned Teams:
Service Arch
Operating System: ALL
Participants:

 Description   

From SERVER-53035: 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.

An ASSERT failure from a non-main thread is going to throw an exception that the thread callback can't catch, and so the test will std::terminate. ASSERT statements always pass (or the test would be red), but there's a difference between an aborted test and a failed test. If you wanted an aborted test you'd use an invariant.

 

 

To identify ASSERT statements that are misplaced, perhaps we can just fail ALL ASSERTS from an unsafe thread to identify the dangerous tests before they bite.


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