Skip to content

Commit 31299ab

Browse files
authored
Retry drop on Interrupted server error (#1331)
JAVA-5352
1 parent d143d90 commit 31299ab

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

driver-core/src/test/functional/com/mongodb/client/test/CollectionHelper.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ public static void drop(final MongoNamespace namespace, final WriteConcern write
103103
} catch (MongoWriteConcernException e) {
104104
LOGGER.info("Retrying drop collection after a write concern error: " + e);
105105
// repeat until success!
106+
} catch (MongoCommandException e) {
107+
if ("Interrupted".equals(e.getErrorCodeName())) {
108+
LOGGER.info("Retrying drop collection after an Interrupted error: " + e);
109+
// repeat until success!
110+
} else {
111+
throw e;
112+
}
106113
}
107114
}
108115
}

0 commit comments

Comments
 (0)