[GODRIVER-1965] Pre-write context expiration should not be considered a network error Created: 13/Apr/21  Updated: 28/Oct/23  Resolved: 17/Aug/22

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

Type: Bug Priority: Major - P3
Reporter: Divjot Arora (Inactive) Assignee: Benji Rewis (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to GODRIVER-2468 Don't check Context expiration in Wit... Closed
is related to GODRIVER-2065 Error early if insufficient time rema... Closed
Epic Link: Client Side Operations Timeout
Quarter: FY23Q2, FY23Q3

 Description   

The connection#writeWireMessage function does an optimistic check for context expiration and returns an error without writing to the socket because it knows the write will fail anyway. This is a good idea, but the error is considered a network timeout by the operations layer, which is incorrect. We should either remove this check altogether or move it into the Operation#Execute function and not call WriteWireMessage at all if the context is expired.



 Comments   
Comment by Githook User [ 06/Sep/22 ]

Author:

{'name': 'Benjamin Rewis', 'email': 'benji.rewis@mongodb.com', 'username': 'benjirewis'}

Message: Stop treating context errors as network errors where possible. (#1045)

GODRIVER-2468
GODRIVER-1965
Branch: release/1.10
https://github.com/mongodb/mongo-go-driver/commit/c4993a52e199b170c31820e99355ed434a26fdc7

Comment by Githook User [ 17/Aug/22 ]

Author:

{'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}

Message: Stop treating context errors as network errors where possible. (#1045)

GODRIVER-2468
GODRIVER-1965
Branch: release/1.10
https://github.com/mongodb/mongo-go-driver/commit/486441860bbf033cbe721707b1506a639e9140e9

Comment by Benji Rewis (Inactive) [ 10/Aug/22 ]

I think we can remove the checks in both writeWireMessage and readWireMessage and rely on the short-circuiting check as long as we check for all context errors (including cancelation). https://github.com/mongodb/mongo-go-driver/pull/1045

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