[SERVER-15129] Count does not honor maxTimeMS Created: 03/Sep/14  Updated: 10/Dec/14  Resolved: 04/Sep/14

Status: Closed
Project: Core Server
Component/s: JavaScript, Shell
Affects Version/s: 2.7.2, 2.7.5
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Christian Amor Kvalheim Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-14143 Reenable JS interruption Closed
Operating System: ALL
Steps To Reproduce:

var d = db.getSisterDB("t").t;
d.insert({a:1});
d.runCommand({count:'t', query: {"$where": "sleep(1000) || true"}, maxTimeMS:50})

Aborts correctly on 2.6.x but fails on 2.7.5

Participants:

 Description   

the maxTimeMS option is ignored for the count command



 Comments   
Comment by J Rassi [ 04/Sep/14 ]

I confirm this as a dup of SERVER-14143.

Before 2.7.2 (including 2.6.x):

  • Long-running query operations are interruptible during yields of the database read lock.
  • In addition, operations that use server-side Javascript are interruptible when transitioning in and out of Javascript execution.

As of 2.7.2, things are different:

  • SERVER-13922 removed query yielding entirely (including the interrupt point associated with yields).
  • SERVER-14069 removed Javascript interruption entirely.

Thus, the count operation posted above is no longer interruptible. It will be interruptible again once SERVER-14143 restores interrupting Javascript operations.

Comment by J Rassi [ 03/Sep/14 ]

Possible dup of SERVER-14143? Note that <https://github.com/mongodb/mongo/commit/4857b8701526b07b1dedd508e768a980bf21c1dd> disabled the max_time_ms.js core test entirely.

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