-
Type: Story
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Not Needed
Ctrl+C should mimic the old shell behaviour and terminate directly, or after confirmation, the database operations that are still pending for the current line being executed.
Beside providing a more expected UX, this feature also prevents users from exhausting the connection pool on long running operations that should have been supposedly terminated, and would mitigate the issue with asynchronous code being not really interrupted, since most of the async code would be due to database commands. (See attachments).
Note 1:
Other previously running operations should not be terminated.
Note 2:
On ctrl+c we may need to account for code of this kind, where terminating the current operation in progress would not prevent further operations in the same session to be triggered:
for (const line of csv) { try { db.coll1.insertOne(line) } catch (e) { // ignore } }
Note 3: See: https://github.com/10gen/compass-internal-docs/blob/master/technical/misc/tracking-background-operations.md for info about how to track and terminate background operations.
- related to
-
MONGOSH-640 Graceful handling of Ctrl-C
- Closed