code: private void shutdownManagedChannel(ChannelKey channelKey, long shutdownTimeoutMs) {
      ManagedChannel managedChannel = mChannels.get(channelKey).get();
      managedChannel.shutdown();
      try {
        managedChannel.awaitTermination(shutdownTimeoutMs, TimeUnit.MILLISECONDS);
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        // Allow thread to exit.
      } finally {
        managedChannel.shutdownNow();
      }
      Verify.verify(managedChannel.isShutdown());
      LOG.debug("Shut down managed channel. ChannelKey: {}", channelKey);
    }
docs: Shuts down the managed channel for given key.
  
  (Should be called with {@code mLock} acquired.)
  
  @param channelKey channel key
  @param shutdownTimeoutMs shutdown timeout in miliseconds