-
Type:
Bug
-
Resolution: Won't Fix
-
Priority:
Trivial - P5
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Service Arch
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
While investigating CLOUDP-202309, I observed that configureFailPoint seems to ignore times: 0 when closeConnection: true is specified in the data field for the failCommand fail point.
db = db.getSiblingDB('test');
db.test.drop();
db.createCollection('test', { writeConcern: { w: 'majority' }});
db.adminCommand({
configureFailPoint: 'failCommand',
mode: { times: 0 },
data: {
failCommands: ['insert'],
closeConnection: true,
}
});
coll = db.test;
try {
coll.insertOne({ _id: 1 }, );
} catch (e) {
print(e);
}
print(coll.findOne());
With closeConnection: true omitted, the fail point is never triggered and the document is successfully inserted. This seems incorrect, as I would expect the top-level mode parameter to take priority over any fail point-specific options under data.
I ran this script using a local 7.0 replica set with retryable writes disabled (lest the insert succeed on a retry attempt):
mongosh mongodb://127.0.0.1:27070/?retryWrites=false script.js