395 — TruncatedSerialization

concurrencyperformance

The operation could not acquire a lock within the timeout period

What is happening?

LockTimeout indicates that an operation waited for a lock but could not acquire it before the configured timeout expired. This is functionally similar to error 24 (LockTimeout) and occurs when concurrent operations contend for the same resource. Heavy write traffic, long-running transactions, or DDL operations can cause lock contention.

Common causes

  1. Long-running transaction holding a write lock on a frequently accessed collection
  2. Background index build competing with write operations
  3. DDL operation (drop, rename) blocked by active cursors or transactions
  4. High concurrent write throughput on the same collection

Source code references

ErrorCodes::TruncatedSerialization found in 2 locations in the MongoDB server source.

Diagnostic Steps