chihsuan commented on code in PR #11295:
URL: https://github.com/apache/ozone/pull/11295#discussion_r4102067361
##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestInterSCMGrpcClient.java:
##########
@@ -75,6 +75,37 @@ void testDownloadIsAbortedAtConfiguredDeadline() throws
Exception {
}
}
+ /**
+ * The client channel keepalive settings are additive to the deadline: a
+ * stuck download must still be aborted at the configured deadline when
+ * custom keepalive values are set.
+ */
+ @Test
+ void testDownloadIsAbortedAtDeadlineWithCustomKeepAlive() throws Exception {
Review Comment:
Would it be worth adding a test that checks these settings are actually
used? Both new tests still pass if I remove the keepalive lines.
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/InterSCMGrpcProtocolService.java:
##########
@@ -57,9 +57,35 @@ public class InterSCMGrpcProtocolService {
this.port = conf.getInt(ScmConfigKeys.OZONE_SCM_GRPC_PORT_KEY,
ScmConfigKeys.OZONE_SCM_GRPC_PORT_DEFAULT);
+ final long maxConnectionIdle = conf.getTimeDuration(
+ ScmConfigKeys.OZONE_SCM_HA_GRPC_SERVER_MAX_CONNECTION_IDLE,
+ ScmConfigKeys.OZONE_SCM_HA_GRPC_SERVER_MAX_CONNECTION_IDLE_DEFAULT,
+ TimeUnit.MILLISECONDS);
+ final long keepAliveTime = conf.getTimeDuration(
+ ScmConfigKeys.OZONE_SCM_HA_GRPC_SERVER_KEEPALIVE_TIME,
+ ScmConfigKeys.OZONE_SCM_HA_GRPC_SERVER_KEEPALIVE_TIME_DEFAULT,
+ TimeUnit.MILLISECONDS);
+ final long keepAliveTimeout = conf.getTimeDuration(
+ ScmConfigKeys.OZONE_SCM_HA_GRPC_SERVER_KEEPALIVE_TIMEOUT,
+ ScmConfigKeys.OZONE_SCM_HA_GRPC_SERVER_KEEPALIVE_TIMEOUT_DEFAULT,
+ TimeUnit.MILLISECONDS);
+ final long permitKeepAliveTime = conf.getTimeDuration(
+ ScmConfigKeys.OZONE_SCM_HA_GRPC_SERVER_PERMIT_KEEPALIVE_TIME,
+ ScmConfigKeys.OZONE_SCM_HA_GRPC_SERVER_PERMIT_KEEPALIVE_TIME_DEFAULT,
+ TimeUnit.MILLISECONDS);
+ final boolean permitKeepAliveWithoutCalls = conf.getBoolean(
+ ScmConfigKeys.OZONE_SCM_HA_GRPC_SERVER_PERMIT_KEEPALIVE_WITHOUT_CALLS,
+ ScmConfigKeys
+ .OZONE_SCM_HA_GRPC_SERVER_PERMIT_KEEPALIVE_WITHOUT_CALLS_DEFAULT);
+
NettyServerBuilder nettyServerBuilder =
((NettyServerBuilder) ServerBuilder.forPort(port))
- .maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE);
+ .maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE)
+ .maxConnectionIdle(maxConnectionIdle, TimeUnit.MILLISECONDS)
+ .keepAliveTime(keepAliveTime, TimeUnit.MILLISECONDS)
+ .keepAliveTimeout(keepAliveTimeout, TimeUnit.MILLISECONDS)
+ .permitKeepAliveTime(permitKeepAliveTime, TimeUnit.MILLISECONDS)
+ .permitKeepAliveWithoutCalls(permitKeepAliveWithoutCalls);
Review Comment:
Just curious, could we keep this at gRPC's default, `false`? I tried a slow
download where the server waits before sending any data, and it still worked
with `false`. This setting seems to only matter when a client pings with no
request running, and our client never does that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]