[SERVER-12595] findandmodify not honoring maxTimeMS Created: 04/Feb/14 Updated: 11/Jul/16 Resolved: 05/Feb/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Concurrency |
| Affects Version/s: | 2.5.5 |
| Fix Version/s: | 2.6.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Robert Moore | Assignee: | Eric Milkie |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux XXX 3.12.8-300.fc20.x86_64 #1 SMP Thu Jan 16 01:07:50 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux $ ./mongod --version |
||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | Linux | ||||||||
| Steps To Reproduce: | See description. |
||||||||
| Participants: | |||||||||
| Description |
|
The findandmodify command the group commands are not honoring the maxTimeMS option. Here is an example using the findandmodify command:
In the server logs I see:
Similar for the group command:
and in the log:
Note: I am only manually creating the commands so I can inspect the full results. |
| Comments |
| Comment by Robert Moore [ 06/Feb/14 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
Eric - Good too see the fix for findAndModify go in. As requested I created ticket Rob. | ||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 05/Feb/14 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}Message: | ||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Eric Milkie [ 05/Feb/14 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
I've modifed the subject a bit now. Can you make a separate ticket for the 'text' command? It may need a different fix to get working. | ||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Robert Moore [ 05/Feb/14 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
I was able to duplicate the group timeout by moving it out of the'group' sub document. For the text command I don't see a helper function in the docs. The runCommand I used was modified from the examples here: http://docs.mongodb.org/manual/reference/command/text/. I also tried this format for the text command with the same result.
Rob. | ||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Eric Milkie [ 04/Feb/14 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
I believe the same is true for the 'text' command. I would try making maxTimeMS a parameter to the runCommand shell helper function. | ||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Eric Milkie [ 04/Feb/14 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
For the "group" command, if you pass the maxTimeMS parameter as a parameter to the runCommand function rather than as a parameter to the group command (i.e. the same way you are passing it for other commands such as findAndModify), it will work, although the error message just shows it was interrupted and doesn't specify that it was due to the maximum time limit being reached:
| ||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Eric Milkie [ 04/Feb/14 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
I added a yield policy to Helpers::findOne() and this alleviates the issue, at least with findAndModify. I need to check with some other engineers to see if this solution is viable. | ||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Eric Milkie [ 04/Feb/14 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
I did some initial testing of findAndModify. The first thing it does (when your query does not have a 'sort') is do a findOne() to get the document. That helper just uses a simple Runner to find the document, and in my testing it's not yielding in the ~100ms or so that it takes to scan the collection. I'm going to play around with this a bit more. | ||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Robert Moore [ 04/Feb/14 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
Just discovered that the 'text' command is also ignoring the timeout.
And again in the server log we see that the command is over the 100 ms limit:
|