(api) Clean up incorrect error handling in GrpcChannelPool
This commit is contained in:
parent
296ccc5f8e
commit
f9b6ac03c6
@ -44,9 +44,16 @@ public abstract class GrpcChannelPool<STUB> {
|
||||
}
|
||||
|
||||
private ManagedChannel refreshChannel(ServiceAndNode serviceAndNode, ManagedChannel old) {
|
||||
if (old == null || old.getState(true) != SHUTDOWN) {
|
||||
if (old == null)
|
||||
return createChannel(serviceAndNode);
|
||||
|
||||
// If the channel is in SHUTDOWN state, we need to create a new one
|
||||
// (shouldn't really happen in practice, but it's a good idea to be safe)
|
||||
if (old.getState(true) == SHUTDOWN) {
|
||||
old.shutdown();
|
||||
return createChannel(serviceAndNode);
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user