[
https://issues.apache.org/jira/browse/HDDS-14430?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Attila Doroszlai reassigned HDDS-14430:
---------------------------------------
Assignee: Neo Chien
> GrpcOmTransport.shutdown() could wait up to number_of_channels * 5s
> -------------------------------------------------------------------
>
> Key: HDDS-14430
> URL: https://issues.apache.org/jira/browse/HDDS-14430
> Project: Apache Ozone
> Issue Type: Bug
> Reporter: Andrey Yarovoy
> Assignee: Neo Chien
> Priority: Major
> Labels: pull-request-available
>
> Shutdown logic in GrpcOmTransport should not use awaitTermination() on each
> channel and use separate loop with periodic check of channel.isTerminated()
> with overall limit of 5s. With current logic in worst case scenario
> shutdown() can wait up to number_of_channels * 5s and shutdown channels
> sequentially.
> {code:java}
> public void shutdown() {
> for (Map.Entry<String, ManagedChannel> entry:channels.entrySet()) {
> ManagedChannel channel = entry.getValue();
> channel.shutdown();
> try {
> channel.awaitTermination(5, TimeUnit.SECONDS);
> } catch (Exception e) {
> LOG.error("failed to shutdown OzoneManagerServiceGrpc channel {} : {}",
> entry.getKey(), e); } }
> LOG.info("{}: stopped", CLIENT_NAME);
> }{code}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]