[SERVER-56880] Make sure random_DDL_CRUD_operations.js releases the jstest collection mutex on failure Created: 12/May/21  Updated: 29/Oct/23  Resolved: 12/May/21

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

Type: Task Priority: Major - P3
Reporter: Jordi Serra Torrens Assignee: Jordi Serra Torrens
Resolution: Fixed Votes: 0
Labels: PM-1965-Cleanup
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2021-05-17
Participants:

 Description   

The random_DDL_CRUD_operations.js FSM takes a mutex to serialize drop and CRUD states on the same collection.
If a command fails while the mutex is held, that thread will throw and never unlock the mutex. This will cause the other FSM threads to potentially wait infinitely trying to take the mutex, and eventually the test fails because of timeout. This is not desirable because:

  • The test will take a long time until it timesout. It would be better if it fails more promptly
  • It is more difficult to triage the failure, since all of them manifest as test-timeout acquiring that mutex.

Instead, we could use a try-catch-finally block to make sure that the mutex gets unlocked even if the command fails. Here for the drop state, and here for the CRUD state



 Comments   
Comment by Githook User [ 12/May/21 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-56880 Make sure random_DDL_CRUD_operations.js releases the jstest collection mutex on failure
Branch: master
https://github.com/mongodb/mongo/commit/834141425095afacc54c01234602468a353980ff

Generated at Thu Feb 08 05:40:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.