[SERVER-70916] Remove unnecessary acquisition of mutex from access blocker registry method Created: 27/Oct/22  Updated: 29/Oct/23  Resolved: 07/Nov/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Christopher Caplinger Assignee: Christopher Caplinger
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Server Serverless 2022-10-31, Server Serverless 2022-11-14
Participants:
Linked BF Score: 128

 Description   

TenantMigrationAccessBlockerRegistry::getAsyncBlockingOperationsExecutor() currently attempts to acquire the registry mutex in order to access _asyncBlockingOperationsExecutor. This can lead to a deadlock with TenantMigrationRecipientAccessBlocker or TenantMigrationDonorAccessBlocker, since these classes call back into the registry. Ideally, we should avoid calling back into the registry from members of the registry, but refactoring this and moving _asyncBlockingOperationsExecutor is non-trivial at this point. Instead, since _asyncBlockingOperationsExecutor is created when the registry is instantiated and reset only when it is shut down/destroyed, we can avoid synchronization entirely for this executor.



 Comments   
Comment by Githook User [ 04/Nov/22 ]

Author:

{'name': 'Christopher Caplinger', 'email': 'christopher.caplinger@mongodb.com', 'username': 'UnicodeSnowman'}

Message: SERVER-70916: Don't acquire mutex in blocker registry method
Branch: master
https://github.com/mongodb/mongo/commit/e9b4cc2cfefad438838906eefff59c7bc5c412f3

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