I've been getting this error lately when running my tests. I tried it with a local MongoDB server (4.0.5) and I've tried it on Mongo Atlas but experiencing the same problem.
I tried increasing the lock timeout but that has no effect.
I'm not sure what the problem is.
{ MongoError: Unable to acquire lock '{8576955153473224393: Database, 1659426125832142537}' within a max lock request timeout of '5ms' milliseconds.
at queryCallback (/home/user/workspace/my-project/node_modules/mongodb-core/lib/cursor.js:248:25)
at /home/user/workspace/my-project/node_modules/mongodb-core/lib/connection/pool.js:532:18
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickDomainCallback (internal/process/next_tick.js:219:9)
errorLabels: [ 'TransientTransactionError' ],
operationTime: Timestamp { _bsontype: 'Timestamp', low_: 29, high_: 1548245676 },
ok: 0,
errmsg: 'Unable to acquire lock \'{8576955153473224393: Database, 1659426125832142537}\' within a max lock request timeout of \'5ms\' milliseconds.',
code: 24,
codeName: 'LockTimeout',
'$clusterTime':
{ clusterTime: Timestamp { _bsontype: 'Timestamp', low_: 29, high_: 1548245676 },
signature: { hash: [Object], keyId: 0 } },
name: 'MongoError',
[Symbol(mongoErrorContextSymbol)]: {} }