[SERVER-13064] mongo shell hangs on parser error and does not issue error Created: 05/Mar/14  Updated: 10/Dec/14  Resolved: 05/Mar/14

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: 2.6.0-rc0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Bruce W. Hard Assignee: Unassigned
Resolution: Done Votes: 0
Labels: MongoShellHangs
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CentOS release 6.5


Operating System: Linux
Steps To Reproduce:

Test Case - Enter a command with a syntax error as follows:
mongo
MongoDB shell version: 2.6.0-rc0
connecting to: test
> show collections;
cars
system.indexes
temperature
users
– Now issue a command with a syntax error missing the closing "}"
> db.cars.find({)
– The shell issues ... but no error message or indication what is wrong and it just "hangs"

Participants:

 Description   

MongoDB shell version: 2.6.0-rc0
The mongo shell hangs on a parser error and does not issue an error.
Test Case
mongo
MongoDB shell version: 2.6.0-rc0
connecting to: test
> show collections;
cars
system.indexes
temperature
users
– Now issue a command with a syntax error missing the closing "}"
> db.cars.find({)
– The shell prints three dots ... but no error message or indication what is wrong and it just "hangs"



 Comments   
Comment by Daniel Pasette (Inactive) [ 05/Mar/14 ]

The ellipsis (three dots) is meant to signify that it is waiting for more input. This allows you to complete multi-line code stanzas in the repl. For example:

> for(i=0;i< 10;i++) {
... db.foo.insert({})
... }
> db.foo.count()
10

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