[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:
Duplicate
is duplicated by SERVER-33927 The NoopWriter is not resilient to `I... Closed
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: SERVER-33674 Require GlobalLocks with deadlines to specify interrupt behavior when interrupted
Branch: master
https://github.com/mongodb/mongo/commit/07d7a7095a7ebb116b0d02a4ac396620710e9e77

Generated at Thu Feb 08 04:34:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.