Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-5783

Documents never written to database after 100% CPU (causing MongoPoolClearedError)

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.16.0
    • Component/s: Error
    • Labels:
    • 2
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      What problem are you facing?

      When our server (temporarily) reaches 100% CPU due to a brief activity spike MongoDB will throw a (Mongo)PoolClearedError.

      During this time, any changes (insert/update/remove) received are not reflected in the database, which is fine. However they are also not processed AFTER the server recovers (without a hard process restart or anything).

      What driver and relevant dependency versions are you using?

      MongoDB Node.js Driver 4.16, although looking at the code, I expect this issue to be present in 6.x as well.

      MongoDB 6.0.12

      Steps to reproduce?

      Trigger a (Mongo)PoolClearedError while the waitQueue is being processed, and some or all of the entries in the waitQueue will not be processed, even after the server reconnects.

      Possible cause

      I think this problem may be caused by this check in server.ts:

                if (!(err instanceof PoolClearedError)) {
                  this.handleError(err);
                }

      It seems like any error besides the PoolClearedError is handled, but PoolClearedErrors are not?

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            k.lavrijssen@gmail.com Koen Lavrijssen
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: