[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:
Depends
is depended on by SERVER-68868 Remove all instances of Uninterruptib... Blocked
Related
related to SERVER-68247 Support mongo-authored clang-tidy plu... Closed
is related to SERVER-68868 Remove all instances of Uninterruptib... Blocked
is related to SERVER-71734 Use clang-tidy to prevent new instanc... Closed
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: SERVER-68867 Add simplecpplint check for UninterruptibleLockGuard
Branch: master
https://github.com/mongodb/mongo/commit/fe588e79d92b90eaf3a057e8fca78c0b8b8169fd

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?

Generated at Thu Feb 08 06:11:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.