[GODRIVER-2218] Update connection idle deadline when checking connection back into pool Created: 05/Nov/21  Updated: 28/Oct/23  Resolved: 17/Mar/22

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

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

Epic Link: Avoiding connection storms
Quarter: FY22Q4

 Description   

Currently a connection's "idle deadline" is increased in the Go driver only when reading writing to the connection. However, the CMAP spec defines "idle" as:

Idle: The Connection is currently "available" (as defined below) and has been for longer than maxIdleTimeMS.

"Available" is defined as:

The Connection has been established and is waiting in the pool to be checked out.

As a result, it's currently possible to check in a connection to the pool that has not been read from or written to for more than maxIdleTimeMS and it will be considered stale due to idle timeout. According to the definition of "idle" in the CMAP spec, that should be impossible.

Update the Go driver to increase the connection's idle deadline when it is checked into the pool.



 Comments   
Comment by Githook User [ 17/Mar/22 ]

Author:

{'name': 'Matt Dale', 'email': '9760375+matthewdale@users.noreply.github.com', 'username': 'matthewdale'}

Message: GODRIVER-2218 Bump connection idle deadline on pool checkIn. (#869)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/6f63c263421074a709024cedcd2a8d0879b99639

Comment by Matt Dale [ 10/Mar/22 ]

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

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