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

Rui Wang resolved RATIS-2805.
-----------------------------
    Fix Version/s: 3.4.0
       Resolution: Fixed

> GrpcUtil: shutdownManagedChannels vs shutdownManagedChannel subtle 
> differences 
> -------------------------------------------------------------------------------
>
>                 Key: RATIS-2805
>                 URL: https://issues.apache.org/jira/browse/RATIS-2805
>             Project: Ratis
>          Issue Type: Improvement
>          Components: gRPC
>            Reporter: Tsz-wo Sze
>            Assignee: Tsz-wo Sze
>            Priority: Major
>             Fix For: 3.4.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Claude: shutdownManagedChannels vs shutdownManagedChannel subtle differences 
> (GrpcUtil.java):
>    - The original skips the graceful phase when gracefulTimeout is not 
> positive. The new code has no such check.
>      The defaults are constant (3s/2s), so there is no behavior change today. 
> But the two methods would diverge if someone adds
>      configurable timeouts later. Consider taking (graceful, forceful) params 
> like the 3-arg overload.
>    - On InterruptedException the first awaitTermination returns early. The 
> forceful phase still runs
>      shutdownNow on all of them (good), but its await is skipped immediately 
> because the interrupt flag is set. This matches the old
>      behavior, so it is fine.
>    - shutdownManagedChannel(ManagedChannel) could now just delegate to
>      shutdownManagedChannels(Collections.singletonList(c)) to avoid two 
> copies of the logic (optional).



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to