Is there a way to command a channel to gracefully shutdown, waiting for any active calls to complete before terminating the link?
I expected channel.shutdown() to work this way. However, it appears to forcefully kill all active calls after 5 seconds with UNAVAILABLE (Channel requested transport to shut down) exceptions.
The 5 second delay appears to be due to a shutdown delay hack in SubchannelImplImpl::shutdown.
Is this expected behavior?
I am writing a custom LoadBalancer and I need a way to evict subchannels cleanly.
Currently, my solution is to remove the subchannel from the Picker then shutting it down once its state changes to IDLE in handleSubchannelState. I don't expect this is the intended way to go about this?
Also, from what I can tell, this may manifest in the RoundRobinLoadBalancer. When the resolved address list changes, any active calls that last longer than 5 seconds will be killed.