[ 
https://issues.apache.org/jira/browse/HDDS-14430?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Attila Doroszlai resolved HDDS-14430.
-------------------------------------
    Fix Version/s: 2.2.0
       Resolution: Fixed

> 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
>             Fix For: 2.2.0
>
>
> 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]

Reply via email to