[SERVER-54538] Make assertions in thread_context_test thread-safe Created: 12/Feb/21 Updated: 29/Oct/23 Resolved: 13/May/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 5.0.0-rc0 |
| 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: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | ALL | ||||
| Sprint: | Service Arch 2021-05-17 | ||||
| Participants: | |||||
| Linked BF Score: | 0 | ||||
| Description |
|
It is unsafe to assert from the spawned threads in unit-tests, as such assertions are process fatal. We should change the assertions in thread_context_test (e.g., here) to be thread-safe. This could be done by using the ThreadAssertionMonitor. Moreover, the spawned threads could access non-thread safe metrics (shown below) that are defined here. Accessing these metrics must be serialized (e.g., by using atomics or a mutex) to ensure thread-safety.
|
| Comments |
| Comment by Githook User [ 13/May/21 ] |
|
Author: {'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}Message: Synchronize access to counters. Make one ThreadAssertionMonitor outside test body, to avoid |
| Comment by Billy Donahue [ 13/May/21 ] |
| Comment by Githook User [ 11/May/21 ] |
|
Author: {'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}Message: Revert " This reverts commit 496b1a7b6deac14044d870329be2fbe948ad22dd. |
| Comment by Githook User [ 10/May/21 ] |
|
Author: {'name': 'Luis Osta', 'email': 'luis.osta@mongodb.com', 'username': 'LuisOsta'}Message: |