summaryrefslogtreecommitdiff
path: root/src/mongo/db/repair_database.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repair_database.cpp')
-rw-r--r--src/mongo/db/repair_database.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/db/repair_database.cpp b/src/mongo/db/repair_database.cpp
index 2ff3eb85056..93773d7fdc4 100644
--- a/src/mongo/db/repair_database.cpp
+++ b/src/mongo/db/repair_database.cpp
@@ -269,6 +269,9 @@ Status repairDatabase(OperationContext* opCtx,
dbHolder().close(opCtx, dbName, "database closed for repair");
ON_BLOCK_EXIT([&dbName, &opCtx] {
try {
+ // Ensure that we don't trigger an exception when attempting to take locks.
+ UninterruptibleLockGuard noInterrupt(opCtx->lockState());
+
// Open the db after everything finishes.
auto db = dbHolder().openDb(opCtx, dbName);