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

Shell exits if interrupted during changeStreamCursor.next()

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.0.1
    • Affects Version/s: None
    • Component/s: Services Providers
    • None
    • Iteration Geneva
    • Not Needed

      $ NODE_OPTIONS='--stack-trace-limit=1000' mongosh $CLUSTER
      Current Mongosh Log ID:	60ec236264335df3b521a0bd
      Connecting to:		mongodb+srv://<credentials>@cluster0.ucdwm.mongodb.net/
      Using MongoDB:		4.4.6
      Using Mongosh:		0.0.0-dev.0
      
      For mongosh info see: https://docs.mongodb.com/mongodb-shell/
      
      Atlas atlas-jt9dqp-shard-0 [primary] test> db.watch().next()
      Warning: If there are no documents in the batch, next will block. Use tryNext if you want to check if there are any documents without waiting.
      Stopping execution...
      Atlas atlas-jt9dqp-shard-0 [primary] test> /home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/utils.js:518
                          throw error;
                          ^
      
      MongoDriverError: MongoClient must be connected to perform this operation
          at Object.getTopology (/home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/utils.js:384:11)
          at processError (/home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/change_stream.js:403:34)
          at /home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/change_stream.js:106:25
          at /home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/utils.js:514:17
          at /home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/cursor/abstract_cursor.js:535:55
          at /home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/utils.js:524:9
          at /home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/sessions.js:102:24
          at Object.maybePromise (/home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/utils.js:510:5)
          at ClientSession.endSession (/home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/sessions.js:100:24)
          at cleanupCursor (/home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/cursor/abstract_cursor.js:557:17)
          at /home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/cursor/abstract_cursor.js:535:20
          at /home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/change_stream.js:270:24
          at /home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/cmap/connection_pool.js:250:25
          at handleOperationResult (/home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/sdam/server.js:397:9)
          at Object.operationDescription.cb (/home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/cmap/connection.js:571:17)
          at Connection.handleIssue (/home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/cmap/connection.js:139:20)
          at TLSSocket.<anonymous> (/home/addaleax/src/mongosh/packages/service-provider-server/node_modules/mongodb/lib/cmap/connection.js:61:39)
          at TLSSocket.emit (events.js:388:22)
          at TLSSocket.emit (domain.js:470:12)
          at net.js:673:12
          at TCP.done (_tls_wrap.js:563:7)
          at TCP.callbackTrampoline (internal/async_hooks.js:134:14)
      

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

              Created:
              Updated:
              Resolved: