[SERVER-19846] Remove existing usages of timed_mutex and disallow new uses Created: 10/Aug/15  Updated: 19/Sep/15  Resolved: 24/Aug/15

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.1.8

Type: Task Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-19759 add a configure check for std::timed_... Closed
related to SERVER-20254 Re-enable auth workloads in the concu... Closed
Backwards Compatibility: Fully Compatible
Sprint: Platform 8 08/28/15
Participants:

 Description   

We have had two non-trivial issues related to std::timed_mutex, see SERVER-19759 and SERVER-19535.

We should remove all existing usages of std::timed_mutex and disallow novel usages. For situations where we must use timed_mutex, we should use boost::timed_mutex under NOLINT.



 Comments   
Comment by Githook User [ 24/Aug/15 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-19846 Ban uses of std::timed_mutex
Branch: master
https://github.com/mongodb/mongo/commit/1a02e9f98305c6de293e98bfbdcc69f5cc33b9e0

Comment by Andy Schwerin [ 10/Aug/15 ]

The timed_mutex was actually moved from authz_manager_external_state_d.h/cpp when we restructured the user management commands to not require the distributed lock on mongos. In so doing, we actually made the timed_mutex safe to replace with a stdx::mutex, dropping the timeout. We only had the lock acquisition time limit because we needed it for the distributed lock variant, and it was easier to have symmetry in the two implementations.

Comment by Andreas Nilsson [ 10/Aug/15 ]

The use of timed_mutex in user_management_commands.cpp was added pretty recently by alabid in https://github.com/mongodb/mongo/commit/b631186c3bde82f4894b31b58c769a9e83453601#diff-f587ec891abd60f174b15c8b985802a5

I'd have to refer to spencer or schwerin to answer if it/how it can be removed.

Generated at Thu Feb 08 03:52:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.