[SERVER-29327] Prevent DBDirectClient queries from storing MaxTimeMS on cursors Created: 23/May/17  Updated: 30/Oct/23  Resolved: 05/Jun/17

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: None
Fix Version/s: 3.4.7, 3.5.9

Type: Bug Priority: Major - P3
Reporter: Spencer Jackson Assignee: Spencer Jackson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
related to TOOLS-1603 'mongorestore' utility failed to rest... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.4
Sprint: Platforms 2017-05-29, Platforms 2017-06-19
Participants:

 Description   

For sanity's sake, MaxTimeMS is not allowed to be used on queries and getmores performed by DBDirectClients. However, cursors and OperationContexts both store their own representations of when they should timeout. Queries store the OperationContext's timeout on themselves as they finish. This means that a getmore performed inside a DBDirectClient may see the OperationContext's timeout and believe the MaxTimeMS was directly provided to it, and fail.

We can assume that all operations performed by a DBDirectClient will occur inside the same OperationContext. Because DBDirectClient cursors will never cross OperationContexts, we can keep the original timeout on the OperationContext, and never transfer it to the cursor, allowing the getmore to succeed.



 Comments   
Comment by Githook User [ 11/Jul/17 ]

Author:

{u'username': u'spencerjackson', u'name': u'Spencer Jackson', u'email': u'spencer.jackson@mongodb.com'}

Message: SERVER-29327: Prevent DBDirectClient from storing MaxTimeMS on cursors

(cherry picked from commit 7d5b5cd998df4a8532748c2a59fce06c305122d8)
Branch: v3.4
https://github.com/mongodb/mongo/commit/57069e87a5237c9026e985b01f8fef504de3f62f

Comment by Githook User [ 05/Jun/17 ]

Author:

{u'username': u'spencerjackson', u'name': u'Spencer Jackson', u'email': u'spencer.jackson@mongodb.com'}

Message: SERVER-29327: Prevent DBDirectClient from storing MaxTimeMS on cursors
Branch: master
https://github.com/mongodb/mongo/commit/7d5b5cd998df4a8532748c2a59fce06c305122d8

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