[SERVER-36873] ReplicationCoordinatorExternalStateImpl::shutdown() must not hold _threadMutex while waiting for _taskExecutor Created: 24/Aug/18  Updated: 29/Oct/23  Resolved: 25/Oct/18

Status: Closed
Project: Core Server
Component/s: Replication, Storage
Affects Version/s: 3.6.8, 4.0.3, 4.1.3
Fix Version/s: 3.6.10, 4.0.5, 4.1.5

Type: Bug Priority: Major - P3
Reporter: Tess Avitabile (Inactive) Assignee: Tess Avitabile (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Duplicate
is duplicated by SERVER-33186 Primary node may deadlock during shut... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0, v3.6
Sprint: Repl 2018-09-24, Repl 2018-10-22, Repl 2018-11-05
Participants:
Linked BF Score: 65

 Description   

ReplicationCoordinatorExternalStateImpl::shutdown() holds _threadMutex while waiting for _taskExecutor. This is problematic, since the _taskExecutor's function takes database locks, so we can wait for database locks while holding _threadMutex. This can lead to deadlock, since we can wait for _threadMutex while holding ReplicationCoordinatorImpl::_mutex, and we can wait for ReplicationCoordinatorImpl::_mutex while holding database locks.



 Comments   
Comment by Githook User [ 14/Nov/18 ]

Author:

{'name': 'Tess Avitabile', 'email': 'tess.avitabile@mongodb.com', 'username': 'tessavitabile'}

Message: SERVER-36873 ReplicationCoordinatorExternalStateImpl::shutdown() must not hold _threadMutex while waiting for _taskExecutor

(cherry picked from commit bb77630bcf397f309e83d5bc64b86c2269ff4bb9)
Branch: v3.6
https://github.com/mongodb/mongo/commit/f8e57019c7c6e05de0b0adb029733b9209b8585f

Comment by Githook User [ 12/Nov/18 ]

Author:

{'name': 'Tess Avitabile', 'email': 'tess.avitabile@mongodb.com', 'username': 'tessavitabile'}

Message: SERVER-36873 ReplicationCoordinatorExternalStateImpl::shutdown() must not hold _threadMutex while waiting for _taskExecutor

(cherry picked from commit bb77630bcf397f309e83d5bc64b86c2269ff4bb9)
Branch: v4.0
https://github.com/mongodb/mongo/commit/7ad4f64b8c88f0249ef6e8f573b71d0509ab699f

Comment by Githook User [ 25/Oct/18 ]

Author:

{'name': 'Tess Avitabile', 'email': 'tess.avitabile@mongodb.com', 'username': 'tessavitabile'}

Message: SERVER-36873 ReplicationCoordinatorExternalStateImpl::shutdown() must not hold _threadMutex while waiting for _taskExecutor
Branch: master
https://github.com/mongodb/mongo/commit/bb77630bcf397f309e83d5bc64b86c2269ff4bb9

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