[SERVER-68867] Use linter to prevent new instances of UninteruptibleLockGuard Created: 16/Aug/22 Updated: 29/Oct/23 Resolved: 25/Nov/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.3.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Andy Schwerin | Assignee: | Yujin Kang Park |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | louis-preferred | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||
| Sprint: | Execution Team 2022-11-14, Execution Team 2022-11-28 | ||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Description |
|
The programming model inside MongoDB requires that all operations be interruptible at certain wait points. However, a small set of code paths were not properly structured to support interruption, and so suppress it by use of the UninterruptibleLockGuard RAII type. As uses of this behavior indicate code that does not comply with the design requirements of MongoDB, they should be flagged by the linter so new instances receive extra scrutiny from authors and code reviewers. |
| Comments |
| Comment by Githook User [ 25/Nov/22 ] |
|
Author: {'name': 'Yu Jin Kang Park', 'email': 'yujin.kang@mongodb.com', 'username': 'ykangpark'}Message: |
| Comment by Alex Neben [ 24/Oct/22 ] |
|
So it seems there is a race here between doing this as part of simplecpplint.py and doing this work in clang-tidy. I am happy to see it done either way. As part of our clang tidy work we are hoping to get rid of simplecpplint.py (and migrate changes there into clang-tidy custom rules). So before work is started on this ticket please dm me so we can sync on where we are with clang-tidy so we don't have to do this work 2x. |
| Comment by Andy Schwerin [ 16/Aug/22 ] |
|
I'm open to any implementation that occurs soon and leads to increased friction for developers who try to use UninterruptibleLockGuard. |
| Comment by Alex Neben [ 16/Aug/22 ] |
|
I wonder if this can be done as a clang tidy check? Maybe it is too much effort for something that can probs be grepped for? |