[SERVER-33674] Require GlobalLocks with deadlines to specify interrupt behavior when interrupted Created: 05/Mar/18 Updated: 29/Oct/23 Resolved: 30/Apr/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | 3.7.3 |
| Fix Version/s: | 4.0.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Louis Williams | Assignee: | Louis Williams |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Storage NYC 2018-04-09, Storage NYC 2018-05-07 | ||||||||
| Participants: | |||||||||
| Description |
|
GlobalLocks with deadlines other than Date_t::max() can throw exceptions, but that behavior is not always expected by users, and requires an extra try-catch block. We should add a required argument to the GlobalLock constructor when passing deadlines other than Date_t::max() that allows GlobalLock::isLocked() to return false even if the operation context was interrupted. Potential implementations include a) using an enum (LEAVE_UNLOCKED_ON_INTERRUPT, THROW_ON_INTERRUPT) or b) a lambda that users must use to implement the desired behavior when the lock is interrupted. |
| Comments |
| Comment by Githook User [ 30/Apr/18 ] |
|
Author: {'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams', 'name': 'Louis Williams'}Message: |