devmadhuu commented on code in PR #11295:
URL: https://github.com/apache/ozone/pull/11295#discussion_r4119344749
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/InterSCMGrpcProtocolService.java:
##########
@@ -57,9 +57,30 @@ 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);
+
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);
Review Comment:
Could we validate or document the relationship between the client
`keepAliveTime` and the server `permitKeepAliveTime`?
Both are independently configurable now. For example, if the client is
configured with `keepAliveTime=30s` while the server has
`permitKeepAliveTime=5m`, the client may send HTTP/2 PINGs more frequently than
the server permits.
Would it make sense to either validate compatible values, document this
constraint, or add a test covering an incompatible client/server configuration?
**`NettyServerBuilder`** documentation: `permitKeepAliveTime` is explicitly
the most aggressive keepalive interval clients are permitted to configure, and
the server may forcefully close connections from clients exceeding that rate
`https://github.com/grpc/grpc-java/blob/master/netty/src/main/java/io/grpc/netty/NettyServerBuilder.java`
--
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]