[JAVA-4646] Deal with consequence of interrupted socket operation throwing SocketException Created: 13/Jun/22  Updated: 07/Sep/23  Resolved: 07/Sep/23

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

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Valentin Kavalenka
Resolution: Done Votes: 0
Labels: loom
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: Virtual Threads Support
Quarter: FY24Q3
Backwards Compatibility: Fully Compatible
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   

When a socket operation is interrupted (say by a call to StructuredTaskScope#joinUntil that times out, tests show that SocketInputStream#read throws a SocketException with the message "Closed by interrupt" . The driver will treat that exception according to the rules defined by the SDAM and CMAP specifications, as a network error. But it should be treated more like InterruptedException.



 Comments   
Comment by Githook User [ 07/Sep/23 ]

Author:

{'name': 'Valentin Kovalenko', 'email': 'valentin.kovalenko@mongodb.com', 'username': 'stIncMale'}

Message: Handle `Socket` IO interruptibility (#1189)

JAVA-4646
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/7ed5e7089e4af5d93399e15a0c4eaca4f1c019cb

Comment by Jeffrey Yemin [ 12/Apr/23 ]

Some ideas here: https://github.com/jyemin/mongo-java-driver/tree/j4646

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