The "staticYield can't unlock" message is printed to the diagnostic log when a a query that cannot yield locks is running for a long time. As of 2.6.0, examples of queries that cannot yield locks include (partial list): findAndModify operations with a sort, queries run inside the "eval" command.
Example message logged by findAndModify with a sort:
2015-05-21T15:34:43.593-0400 [conn6] warning: ClientCursor::staticYield can't unlock b/c of recursive lock ns: top: { opid: 187792, active: true, secs_running: 0, microsecs_running: 275999, op: "query", ns: "test", query: { findandmodify: "foo", query: { a: 1.0 }, sort: { b: 1.0 }, update: { c: 1.0 } }, client: "127.0.0.1:59841", desc: "conn6", threadId: "0x7f407c20d700", connectionId: 6, locks: { ^: "w", ^test: "W" }, waitingForLock: false, numYields: 0, lockStats: { timeLockedMicros: {}, timeAcquiringMicros: { r: 0, w: 7 } } }
It is often the case that these queries are running for a long time because they are unindexed or poorly indexed. In this case, the problem goes away once an appropriate index is created.
However, this message is logged too frequently; it should only be logged periodically. Reducing the frequency that this message is logged will help eliminate log spam for users that don't care that they have long-running queries that cannot yield locks.
This message was removed for version 3.0.0 of the server.
- is duplicated by
-
SERVER-15583 warning: ClientCursor::staticYield can't unlock b/c of recursive lock
- Closed
-
SERVER-16758 Tons of ClientCursor::staticYield on a simple query
- Closed