Skip to content

Commit da70387

Browse files
committed
api: Document A18 TCP_USER_TIMEOUT handling for keepalive
Fixes #12487
1 parent d50098f commit da70387

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

api/src/main/java/io/grpc/ManagedChannelBuilder.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,17 @@ public T maxInboundMetadataSize(int bytes) {
374374
* notice when they are causing excessive load. Clients are strongly encouraged to use only as
375375
* small of a value as necessary.
376376
*
377+
* <p>When the channel implementation supports TCP_USER_TIMEOUT, enabling keepalive will also
378+
* enable TCP_USER_TIMEOUT for the connection. This requires <em>all</em> sent packets to receive
379+
* a TCP acknowledgement before the keepalive timeout. The keepalive time is not used for
380+
* TCP_USER_TIMEOUT, except as a signal to enable the feature. grpc-netty supports
381+
* TCP_USER_TIMEOUT on Linux platforms supported by netty-transport-native-epoll.
382+
*
377383
* @throws UnsupportedOperationException if unsupported
378384
* @see <a href="https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md">gRFC A8
379385
* Client-side Keepalive</a>
386+
* @see <a href="https://github.com/grpc/proposal/blob/master/A18-tcp-user-timeout.md">gRFC A18
387+
* TCP User Timeout</a>
380388
* @since 1.7.0
381389
*/
382390
public T keepAliveTime(long keepAliveTime, TimeUnit timeUnit) {
@@ -393,6 +401,8 @@ public T keepAliveTime(long keepAliveTime, TimeUnit timeUnit) {
393401
* @throws UnsupportedOperationException if unsupported
394402
* @see <a href="https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md">gRFC A8
395403
* Client-side Keepalive</a>
404+
* @see <a href="https://github.com/grpc/proposal/blob/master/A18-tcp-user-timeout.md">gRFC A18
405+
* TCP User Timeout</a>
396406
* @since 1.7.0
397407
*/
398408
public T keepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit) {

0 commit comments

Comments
 (0)