[SERVER-50240] Make CurOp::_numYields atomic Created: 10/Aug/20 Updated: 29/Oct/23 Resolved: 12/Aug/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.7.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Justin Seyster | Assignee: | Justin Seyster |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | qexec-team, thread-sanitizer | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | ALL | ||||
| Sprint: | Query 2020-08-24 | ||||
| Participants: | |||||
| Linked BF Score: | 50 | ||||
| Description |
|
The '_numYields' field gets updated in a single thread, but other threads can read it via $currentOp. These reads can trigger appear as data races in TSAN and are technically undefined behavior. Making '_numYields' atomic silences the TSAN errors and gives us reasonable behavior for the purposes of $currentOp. |
| Comments |
| Comment by Andrew Morrow (Inactive) [ 12/Aug/20 ] |
|
justin.seyster, agreed. Very close. There are three active TSAN build failures that we are tracking before we can expand coverage beyond just jsCore.
Thanks for getting the CurOp issues sorted out. |
| Comment by Justin Seyster [ 12/Aug/20 ] |
|
I think we're really close on TSAN now. The only failure in my patch build was the map-reduce recursion one. |
| Comment by Githook User [ 12/Aug/20 ] |
|
Author: {'name': 'Justin Seyster', 'email': 'justin.seyster@mongodb.com', 'username': 'jseyster'}Message: |