[GODRIVER-2846] Make expected TCP KeepAlive behavior explicit Created: 12/May/23  Updated: 08/Nov/23  Resolved: 01/Aug/23

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

Type: Improvement Priority: Unknown
Reporter: Matt Dale Assignee: Qingyang Hu
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to GODRIVER-37 Set TCP keep alive by default Closed
is related to DRIVERS-383 Enable and configure TCP Keepalive by... Closed
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   

The Go driver currently omits a KeepAlive configuration on the dialer used to dial new TCP connections, allowing the Go net package to use the default KeepAlive configuration (the default since Go 1.11 is KeepAlive enabled with an interval of 15s). Using the default was introduced with GODRIVER-37/DRIVERS-383 (see code review) and has been the behavior of the Go driver since v1.0

However, there are proposals to change the default KeepAlive behavior, either for all applications or in specific circumstances, like when the compile target is Android or iOS (see relevant issue). We should consider setting an explicit KeepAlive or continue using the default and document the rationale and desired behavior.

Definition of done:

  • Investigate the pros/cons of explicitly setting TCP KeepAlive in the Go driver.
  • If we decide to not explicitly enable KeepAlive in the Go driver, document the rationale here and in a comment in the code where the default dialer is constructed (here).


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

Author:

{'name': 'Qingyang Hu', 'email': '103950869+qingyang-hu@users.noreply.github.com', 'username': 'qingyang-hu'}

Message: GODRIVER-2846 Update comments on ClientOptions.SetDialer(). (#1337)
Branch: release/1.12
https://github.com/mongodb/mongo-go-driver/commit/d2f83166ef3e6b4a00c536f8b8e83c9050946ec4

Comment by Githook User [ 01/Aug/23 ]

Author:

{'name': 'Qingyang Hu', 'email': '103950869+qingyang-hu@users.noreply.github.com', 'username': 'qingyang-hu'}

Message: GODRIVER-2846 Update comments on ClientOptions.SetDialer(). (#1337)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/08a5474569f279047aa89090b4b4a3509566966e

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