[SERVER-9238] Shell stops working after long autocomplete operation Created: 04/Apr/13 Updated: 11/Jul/16 Resolved: 20/Sep/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | JavaScript, Shell |
| Affects Version/s: | 2.4.1 |
| Fix Version/s: | 2.4.9, 2.5.3 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | David Verdejo | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 3 |
| Labels: | autocomplete | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
When I try to use autocomplete on the shell, I receive the following error: |
| Comments |
| Comment by Githook User [ 20/Dec/13 ] | ||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}Message: In V8, timeouts are fatal so the shell would become unusable if the | ||||||||||||||||||||||||||||||||||||
| Comment by auto [ 20/Sep/13 ] | ||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}Message: In V8, timeouts are fatal so the shell would become unusable if the | ||||||||||||||||||||||||||||||||||||
| Comment by J Rassi [ 16/Aug/13 ] | ||||||||||||||||||||||||||||||||||||
|
I've reproduced this:
The issue is related to the way that V8Scope objects implement execution time limits. The shell requests that autocompletion be interrupted if it does not finish within 1 second (and e.g. an autocomplete on a collection name will block if another thread is in possession of the global lock). See the following excerpt from mongo::generateCompletions():
SMScope::invoke() leaves the underlying scope intact after interruption. On the other hand, V8Scope::invoke() invalidates the underlying isolate (via V8::TerminateExecution()) during interruption, leaving shellMainScope unable to execute further code. Thus, this affects all shell versions that use V8 (2.4+). | ||||||||||||||||||||||||||||||||||||
| Comment by Rock Li [ 26/Jun/13 ] | ||||||||||||||||||||||||||||||||||||
|
Any updates for this ticket? I met the same issue. It's a bit annoying and frustrating. | ||||||||||||||||||||||||||||||||||||
| Comment by Tatyana Knaifel [ 20/May/13 ] | ||||||||||||||||||||||||||||||||||||
|
happened for me several times on Debian 6 machines. some examples: rs:SECONDARY> db.stats() after some time was fixed by reopening a shell. This wasn't the first time I have encountered this problem, and it was resolved this way every time. | ||||||||||||||||||||||||||||||||||||
| Comment by Daniel Pasette (Inactive) [ 09/Apr/13 ] | ||||||||||||||||||||||||||||||||||||
|
I was able to reproduce twice on a linux machine. While running a load test, I attempted auto-completing for serverStatus by typing "db.serverS<TAB>" and got the same error, afterwards the shell was unusable and had to be restarted. After restarting, I tried tab completing on the collection name in "db.number<tab>" and had the same result. Haven't been able to repro since. This is with v2.4.1. | ||||||||||||||||||||||||||||||||||||
| Comment by Tad Marshall [ 09/Apr/13 ] | ||||||||||||||||||||||||||||||||||||
|
I saw something like this on another user's machine here (linux), so it's not just you and it's not just Windows. We'll try to figure out what goes wrong, perhaps working backwards from the case that I can reproduce (when I stop the server and then try to autocomplete something based on the 'db' variable). The difference in your case is that the server is not stopped, but it happens anyway. | ||||||||||||||||||||||||||||||||||||
| Comment by David Verdejo [ 05/Apr/13 ] | ||||||||||||||||||||||||||||||||||||
|
I made more test today but I couldn't reproduce the error. Please, could you close the ticket? If I could reproduce the error and Kind regards, | ||||||||||||||||||||||||||||||||||||
| Comment by Tad Marshall [ 04/Apr/13 ] | ||||||||||||||||||||||||||||||||||||
|
Interestingly, I don't get the extra "JavaScript execution terminated" text when I try this in Ubuntu 12.04 (testing 2.4.1 Linux-64). | ||||||||||||||||||||||||||||||||||||
| Comment by Tad Marshall [ 04/Apr/13 ] | ||||||||||||||||||||||||||||||||||||
|
I think that I've seen something similar to what you've described, but I'm unable to duplicate this error following your steps with a working connection to a mongod server. I tried with an exiting test.test collection and without one. The first tab completes as far as "getInd", a second tab does nothing (it probably beeps, but I have no sound on this machine) and a third tab displays the possible completions:
I was able to get something more similar if I terminate the mongod server after starting the mongo shell. In the following output, the mongod was running when I started the shell, then I stopped it with ctrl-C before typing "db.test.getIn<tab>". I hit tab a second time and got the "trying reconnect" message followed by the "JavaScript execution terminated" message. I then hit return and got a redraw of my text (without the prompt), followed by another "JavaScript execution terminated" and then the final "error2:JavaScript execution terminated".
Is it possible that the mongod server connection was down when you were doing this test? I can get output like yours if the server is already known by the shell to be down before I try typing the command:
This seems somewhat related to For comparison, this is the output from version 2.2.4 when I try the test there:
We don't get the "JavaScript execution terminated" text and we do get the autocompletions displayed, but we still get error messages mixed with the input text. |