24 LockTimeout: Operation exceeded time limit waiting for a lock
MongoDBWhat does it mean?
An operation exceeded its time limit while waiting for a required lock (e.g. at database/collection level) and was aborted. The lock could not be acquired in time.
Why does it happen?
A long-running operation or DDL command (e.g. conflicting administrative operations on a collection) holds the required lock; heavy concurrent writes; or an operation bounded by maxTimeMS expires while waiting for a lock. Seen with conflicting index/collection operations.
How to fix it
Find the operation holding the lock: inspect active and waiting operations with db.currentOp(); terminate it with db.killOp() if necessary. Move conflicting administrative commands (index builds, collMod, compact) to off-peak hours. Keep operations short and avoid unnecessarily long transactions. If needed, tune maxTimeMS to the workload.
More from this engine
- 10107 NotWritablePrimarynot master / not writable primary
- 91 ShutdownInProgressThe server is in the process of shutting down
- 189 PrimarySteppedDownPrimary stepped down while operation was in progress
- 7 HostNotFoundCould not find host
- 175 QueryPlanKilledQuery plan killed during execution
- 11602 InterruptedDueToReplStateChangeOperation interrupted due to a replication state change
- 136 CappedPositionLostCapped collection position lost