[SERVER-2986] Mongo CLI responds poorly to the use of CTRL-C Created: 22/Apr/11 Updated: 30/Apr/19 Resolved: 31/Jul/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Admin, JavaScript, Shell |
| Affects Version/s: | 1.8.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | John Schulz | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 9 |
| Labels: | polish | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Operating System: | Linux | ||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||||||||||||||
| Description |
|
If a query gets stuck the use of CTRL-C breaks the request but it also breaks the shell session. Each subsequent request to the shell gets the same stack trace response.
|
| Comments |
| Comment by Matt [ 30/Apr/19 ] | ||||||||||||||||||||||||||||||
|
this doesn't seem like it was ever resolved on macos (MongoDB shell version v3.6.5) | ||||||||||||||||||||||||||||||
| Comment by William Zola [ 18/Jan/13 ] | ||||||||||||||||||||||||||||||
|
This still reproduces in 2.2.2, with a different stack trace.
| ||||||||||||||||||||||||||||||
| Comment by Tad Marshall [ 16/Apr/12 ] | ||||||||||||||||||||||||||||||
|
Some parts are easy (don't exit the shell on ^C while at the prompt) and some are hard (try to stop a server process and handle all responses properly). | ||||||||||||||||||||||||||||||
| Comment by Tad Marshall [ 16/Dec/11 ] | ||||||||||||||||||||||||||||||
|
In version 2.1, we are capturing the ctrl-C when we are at the command prompt and can do whatever is appropriate. I will change the behavior to stop using it as an indication that the user wants to exit the shell, you are right, there are other ways to do that. The other issues mentioned, where a restart of the shell error out with a stack trace, will require some testing to see if I can get it into a state to reproduce the bad behavior. | ||||||||||||||||||||||||||||||
| Comment by John Schulz [ 24/Apr/11 ] | ||||||||||||||||||||||||||||||
|
see http://www.faqs.org/docs/bashman/bashref_51.html#SEC51 or http://dev.mysql.com/doc/refman/5.5/en/mysql.html for examples of reasonable behavior for a shell's response to the receipt of ctrl-c. Terminating the current command with a stack trace and then refusing to do anything but display a stack trace on subsequent requests is not reasonable and can be outright confusing. | ||||||||||||||||||||||||||||||
| Comment by Eliot Horowitz (Inactive) [ 23/Apr/11 ] | ||||||||||||||||||||||||||||||
|
agree it should be better, but not exactly sure what "correct" is | ||||||||||||||||||||||||||||||
| Comment by Neil Hooey [ 22/Apr/11 ] | ||||||||||||||||||||||||||||||
|
I believe the shell should do the same thing that bash does when you hit CTRL+C, clear whatever text has been typed at the prompt, print a new prompt line, and most importantly, NOT exit. Here are some reasons I think are important: MySQL has the same problem, and it's really annoying. |