-
Type:
Question
-
Resolution: Gone away
-
Priority:
Major - P3
-
None
-
Affects Version/s: 4.17.1
-
Component/s: Native
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" }
- is related to
-
DRIVERS-3076 HeartbeatFailed events should not be emitted when the client is closed
-
- Backlog
-