[GODRIVER-2065] Error early if insufficient time remains for socket operation Created: 25/Jun/21  Updated: 28/Oct/23  Resolved: 01/Nov/21

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

Type: Improvement Priority: Major - P3
Reporter: Kevin Albertson Assignee: Matt Dale
Resolution: Fixed Votes: 0
Labels: Medium
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to GODRIVER-1965 Pre-write context expiration should n... Closed
is related to GODRIVER-1799 Avoiding connection storms Closed
is related to GODRIVER-2038 Use "ConnectionTimeout" for creating ... Closed
Epic Link: Connection pool improvements

 Description   

Background & Motivation
If a timeout occurs during a network operation the associated connection is closed. That is required since it is impossible to determine the status of the connection or whether it is reusable.

If an operation is executed with a context timeout, and much of the time is spent before executing the network operation there may be insufficient time remaining to complete the network operation. This can cause unnecessary connection churn.

For example, suppose the expected server RTT is 20ms. An "insert" operation is run with a 100ms timeout. There is contention in the connection pool, so 90ms is used up waiting for a connection to become available. With the remaining 10ms, the "insert" is sent, times out, and the connection is closed.

Scope TBD



 Comments   
Comment by Githook User [ 01/Nov/21 ]

Author:

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

Message: GODRIVER-2065 Don't send the operation if the Context deadline is before (now + minimum RTT). (#761)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/02572e2857ee2bca12a9ddd7fa7274b101d51f98

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