Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1492

Built-in shell does not stop executing JS on Ctrl+C

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • None
    • 5

      For long-running JS like

      for (let i = 0; i < 10000; i++) db.test.insertOne({});
      

      pressing Ctrl+C will stop the loop in the mongosh CLI, but not in the embedded shell.

      Note that in the mongosh CLI, we check for interruptions before every call:

      https://github.com/mongodb-js/mongosh/blob/a1f1964cdd632ed63fa1fd8a19091d80f3f1bf68/packages/shell-api/src/decorators.ts#L235

            Assignee:
            Unassigned Unassigned
            Reporter:
            anna.henningsen@mongodb.com Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: