Tsz-wo Sze created RATIS-2805:
---------------------------------
Summary: 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
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)