[SERVER-10665] maxTimeMS doesn't stop active operations Created: 03/Sep/13 Updated: 10/Dec/14 Resolved: 03/Sep/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 2.5.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Sam Weaver | Assignee: | J Rassi |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Operating System: | ALL | ||||
| Participants: | |||||
| Description |
Set the sleep to 10 seconds, set the timeout to 1 second. Run a timer, it only terminates after the 10 seconds are up and not the 1 second... Since javascript $where doesn't allow yielding, or checking for the kill signal for that operation, it runs through to the end of the execution. The same thing can happen with a page fault or other long running part of a query/operation. |
| Comments |
| Comment by J Rassi [ 04/Sep/13 ] |
To clarify: the Javascript engine can be interrupted before/after each call back to native C++. So, using the $where clause "for (i=0;i<10;i++) { sleep(1000); } return true;" instead in your example would in fact cause the query to be interrupted after 1 second (since sleep() in Javascript is just mongo::native_sleep() injected into the scope). |
| Comment by Daniel Pasette (Inactive) [ 03/Sep/13 ] |
|
I've marked this as "Documentation needed" |
| Comment by Eric Milkie [ 03/Sep/13 ] |
|
Operations can only be interrupted at yield points. For the operation you are running, you will find you cannot even run killOp() on it until it finishes. |