[SERVER-4559] when a cursor is timed out, other cursors may last longer than they should Created: 26/Dec/11  Updated: 11/Jul/16  Resolved: 29/Dec/11

Status: Closed
Project: Core Server
Component/s: Concurrency
Affects Version/s: 2.1.1
Fix Version/s: 2.1.0

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Dwight Merriman
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

ClientCursor::idleTimeReport checks for timeouts in two loops. The timing information is only provided in the first loop, and because the first loop is short circuited the timing information may not be provided to all cursors.

for ( CCById::iterator i = clientCursorsById.begin(); i != clientCursorsById.end(); ) {
CCById::iterator j = i;
i++;
if( j->second->shouldTimeout( millis ) )

{ foundSomeToTimeout = true; break; }

}

...

for ( CCById::iterator i = clientCursorsById.begin(); i != clientCursorsById.end(); ) {
CCById::iterator j = i;
i++;
if( j->second->shouldTimeout(0) )

{ numberTimedOut++; LOG(1) << "killing old cursor " << j->second->_cursorid << ' ' << j->second->_ns << " idle:" << j->second->idleTime() << "ms\n"; delete j->second; }

}



 Comments   
Comment by Dwight Merriman [ 28/Dec/11 ]

glad you noticed. important.

Comment by auto [ 28/Dec/11 ]

Author:

{u'login': u'dwight', u'name': u'dwight', u'email': u'dwight@10gen.com'}

Message: SERVER-4559 when a cursor is timed out, other cursors may last longer than they should
Branch: master
https://github.com/mongodb/mongo/commit/873b6e9616c46652817cefc48ba294b6ebef3262

Comment by Dwight Merriman [ 28/Dec/11 ]

glad you found this.
will fix.
side effects

do we have a timeout test? i guess it hasn't manifested.

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