[JAVA-5298] Adjust setSoTimeout to apply to aggregate read Time Created: 23/Jan/24  Updated: 07/Feb/24  Resolved: 07/Feb/24

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

Type: Improvement Priority: Unknown
Reporter: Slav Babanin Assignee: Ross Lawley
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: Client Side Operations Timeout
Quarter: FY24Q3
Assigned Teams:
Java Drivers
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 read method in SocketStream sets the socket timeout (setSoTimeout) only once at the beginning, leading to a refresh of the timeout for each new read. 

Expected Behavior: The aggregate of all reads to receive a server response should be under a single timeout, as per MongoDB's client-side operations timeout specifications.

Acceptance criteria:

  • Update the read method to reset setSoTimeout with the remaining timeout before each inputStream read call, akin to the implementation in SocksSocket.java

Performance Impact: To be determined.


Generated at Thu Feb 08 09:04:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.