[SERVER-17298] listCollections accepts but does not enforce the maxTimeMS option. Created: 16/Feb/15  Updated: 15/Jun/18  Resolved: 15/Jun/18

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 3.0.0-rc8
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Robert Moore Assignee: Ben Judd
Resolution: Done Votes: 1
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2018-06-15 at 5.02.48 PM.png    
Operating System: ALL
Steps To Reproduce:

From the Shell using 3.0.0-rc8

// Create 10000 collections.
> for (var i =0; i < 10000; ++i ) db.getCollection( "test_" + i ).insert({});
WriteResult({ "nInserted" : 1 })
 
// Time and run the listCollections command.
> var start = new Date().getTime(); db.runCommand({"listCollections" : 1, maxTimeMS : 1}); print(new Date().getTime() - start);
9711

Sprint: Storage NYC 2018-06-18
Participants:

 Description   

The listCollections command accepts the maxTimeMS option but does not enforce the timeout.

This is a regression from the 2.6.X model which performed a query on the system.namespaces collection which does enforce the timeout.

Note that the server does imply that the command supports the maxTimeMS with the following error message:

> db.runCommand({"listCollections" : 1, $maxTimeMS : 1}); 
{
	"ok" : 0,
	"errmsg" : "no such command option $maxTimeMS; use maxTimeMS instead"
}


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