[JAVA-4148] Enable TCP_USER_TIMEOUT by default when possible Created: 10/May/21  Updated: 28/Jun/22  Resolved: 17/May/21

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

Type: Improvement Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: spec-compliance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
Related
is related to JAVA-4664 Clarify that socketTimeoutMS affects ... Closed

 Description   

DRIVERS Ticket Description
Script Target - If you can read this text, the script has failed


 Comments   
Comment by Valentin Kavalenka [ 10/May/21 ]

I believe the Linux kernel TCP_USER_TIMEOUT socket option has not yet been implemented neither in OpenJDK JDK, nor in Oracle JDK (see ExtendedSocketOptions and JDK-8038145 Support for Socket option TCP_USER_TIMEOUT), and it is also not part of the Java SE API (see StandardSocketOptions).

Netty implemented this option in its Linux-specific epoll transport implementation (uses OS API directly), which exists in addition to a deprecated OIO and modern NIO transport implementations (these are based on the JDK implementations), and macOS-specific kqueue transport implementation (unfortunately, Apple stopped hosting its man pages long ago, so there is no up-to-date documentation).

Given that the Java driver uses either NIO directly or uses a Netty transport chosen by a user via NettyStreamFactoryFactory.Builder.eventLoopGroup and NettyStreamFactoryFactory.Builder.socketChannelClass, the only way to support TCP_USER_TIMEOUT for us is to specify EpollChannelOption.TCP_USER_TIMEOUT iff a user instructed us to use EpollSocketChannel.

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