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

Write Ops Are Persisted But Sometimes Driver Function Does Not Return

    • 5
    • Not Needed
    • Not Needed

      Use Case

      My database queries all work fine but in production with high load I get this SPORADIC issue:

      Write operations – updateOne mostly, also insert, findOneAndUpdate – get persisted in the database but the node.js mongodb driver function does not return / the returned Promise is neither resolved nor rejected.

      I activated command monitoring and can confirm that ‘commandStarted’ events are fired but neither ‘commandSucceeded’ nor ‘commandFailed’ events appear for these cases. I checked the state of my documents in the db and can confirm that the write operations were successfully persisted – the documents contains the updated info as expected.

      Although the driver does not do much between a ‘commandStarted’ and the ‘commandSucceeded’ / ‘commandFailed’ events – it essentially compresses the message and sends it via a socket – the issue is caused by the driver.

      I am certain because I used the exact same application logic that calls the driver functions and observed the issue with:

      • MongoDB v4.0 (hosted on Scalingo) with the driver v6.5.0
      • MongoDB v7.0 (hosted on Atlas) with driver v6.5.0
      • MongoDB v7.0 (hosted on Atlas) with driver v6.6.1

      But I did not observe the issue with:

      • MongoDB v4.0 (hosted on Scalingo) with driver v3.5.7
      • MongoDB v7.0 (hosted on Atlas) with driver v5.9.2

      It may be worth mentioning that the ops use writeConcern w: 1 and in all cases I was/am running a 3 node replica set.

      User Impact

      • Affected operations do not return and the application logic cannot complete its task
      • Once exactly 100 write ops are “hanging”, ALL queries – reads included – are not executed and hence the application server is essentially down

            Assignee:
            durran.jordan@mongodb.com Durran Jordan
            Reporter:
            contact@dmarcduty.com Nicolai Kamenzky
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: