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

serverHeartbeatFailed trigger problem

    • Type: Icon: Question Question
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.17.1
    • Component/s: Native
    • 2
    • Not Needed
    • 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?

      I'm listening to the serverHeartbeatFailed event and it gets triggered when I close the connection manually. I think this is abnormal behavior because the connection was actively closed by me and it should not have been issued

      code sample:

       

      // create client
      const client = xxxx
      // listen event
      client.on('serverHeartbeatFailed', (e)=>
        { console.log(e) }
      )
      // execute action
      client.xxxx()
      // action done. close client
      client.close()
      

       

      After closing manually I received serverHeartbeatFailed event.
      error info:

       

      {       "code": "ERR_UNKNOWN",       "message": "connection <monitor> to 172.18.164.159:27017 closed",       "stack": "MongoNetworkError: connection <monitor> to 172.18.164.159:27017 closed\n    at Connection.onClose (/Users/yinmeng/Documents/waroom/work/shared/core/packages/mongoose/node_modules/mongodb/src/cmap/connection.ts:338:13)\n    at Socket.<anonymous> (/Users/yinmeng/Documents/waroom/work/shared/core/packages/mongoose/node_modules/mongodb/src/cmap/connection.ts:243:42)\n    at Socket.emit (node:events:525:35)\n    at Socket.emit (node:domain:489:12)\n    at TCP.<anonymous> (node:net:301:12)\n    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)",       "name": "MongoNetworkError"     }
       
      

       
       

       

            Assignee:
            bailey.pearson@mongodb.com Bailey Pearson
            Reporter:
            waroom.yin@gmail.com waroom yin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: