serverHeartbeatFailed trigger problem

XMLWordPrintableJSON

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

      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
              Reporter:
              waroom yin
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: