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

Add a message to unref

    • Type: Icon: Bug Bug
    • Resolution: Won't Do
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 3.5.3
    • Component/s: Core
    • Not Needed

      The Node.js driver's support for unref'ing its connections' sockets appears to be incomplete:

      const mongodb = require("mongodb");const conn = mongodb.MongoClient.connect(url, {useUnifiedTopology: true});
      conn.then(client => {
        const db = client.db();
        db.unref(); // prints "not implemented: `unref`"
      });

      I've tried calling all of the different `unref`s I can find (topology, s, connection, db), but they all end up hitting the not implemented method:

      https://github.com/mongodb/node-mongodb-native/blob/68170da18f6deb2129cd8f9c706bc7d56f72d537/lib/core/sdam/topology.js#L722-L724

      Being able to unref the socket is important for being able to gracefully stop a server.

            Assignee:
            daria.pardue@mongodb.com Daria Pardue
            Reporter:
            zbbjornson@gmail.com Zach Bjornson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: