[SERVER-18620] Reduce frequency of "staticYield can't unlock" log message Created: 21/May/15  Updated: 12/Aug/15  Resolved: 21/May/15

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 2.6.11

Type: Improvement Priority: Major - P3
Reporter: J Rassi Assignee: J Rassi
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-15583 warning: ClientCursor::staticYield ca... Closed
is duplicated by SERVER-16758 Tons of ClientCursor::staticYield on ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Quint Iteration 4
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 21/May/15 ]

Author:

{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-18620 Log "staticYield can't unlock" msg inside RARELY block
Branch: v2.6
https://github.com/mongodb/mongo/commit/69324bb9b3f27306e6c52d7491154074efc22058

Generated at Thu Feb 08 03:48:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.