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

MaxListenersExceededWarning triggered when re-connecting multiple times

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.10.1
    • Affects Version/s: 1.10.0
    • Component/s: Connectivity
    • None
    • Environment:
      OS:
      node.js / npm versions:
      Additional info:
    • 2
    • Not Needed
    • Iteration Dreadnoughtus

      $ mongosh --quiet --eval 'for (let i = 0; i < 10; i++) db.getMongo().setReadPref("secondary")'
      (node:21678) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 mongodb-oidc-plugin:auth-failed listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit

      https://github.com/mongodb-js/devtools-connect/blob/a3e9b17625564177c2fd84443a91bf3078a63aea/src/connect.ts#L338

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

              Created:
              Updated:
              Resolved: