[GODRIVER-2966] ServerHeartbeatStartedEvent does not publish correctly Created: 30/Aug/23  Updated: 08/Nov/23  Resolved: 03/Oct/23

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.12.2

Type: Bug Priority: Major - P3
Reporter: Preston Vasquez Assignee: Qingyang Hu
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on DRIVERS-2677 Clarify whether heartbeat started eve... Implementing
is depended on by GODRIVER-2943 Fix failing logging tests Closed
Gantt Dependency
has to be done before GODRIVER-2943 Fix failing logging tests Closed
Related
related to DRIVERS-2677 Clarify whether heartbeat started eve... Implementing
Documentation Changes: Not Needed
Documentation Changes Summary:

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?


 Description   

From the specifications, ServerHeartbeatStartedEvent should be "published when the server monitor sends its hello or legacy hello call to the server": https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring-logging-and-monitoring.rst#events-api

In addition to publishing before sending a hello command, the Go Driver will publish ServerHeartbeatStartedEvent when checking on the server after a connection is closed / a check is canceled: https://github.com/mongodb/mongo-go-driver/blob/master/x/mongo/driver/topology/server.go#L802 . This is not defined behavior and could result in a publication without sending a hello command to the server.

Suggest removing the block on L802 .



 Comments   
Comment by Githook User [ 08/Nov/23 ]

Author:

{'name': 'Steven Silvester', 'email': 'steven.silvester@ieee.org', 'username': 'blink1073'}

Message: GODRIVER-2966 [master] Remove the heartbeat events after a connection is closed / a check is canceled. (#1409)

Co-authored-by: Qingyang Hu <103950869+qingyang-hu@users.noreply.github.com>
Branch: release/1.12
https://github.com/mongodb/mongo-go-driver/commit/843fc521d658612c4fc8c00a1d0d3bbd8261c99a

Comment by Githook User [ 04/Oct/23 ]

Author:

{'name': 'Steven Silvester', 'email': 'steven.silvester@ieee.org', 'username': 'blink1073'}

Message: GODRIVER-2966 [master] Remove the heartbeat events after a connection is closed / a check is canceled. (#1409)

Co-authored-by: Qingyang Hu <103950869+qingyang-hu@users.noreply.github.com>
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/c0caefe0b2c6628935ddee1f07d7fab65f90e88d

Comment by Qingyang Hu [ 06/Sep/23 ]

PR: https://github.com/mongodb/mongo-go-driver/pull/1378

Generated at Thu Feb 08 08:39:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.