code: private void handleShutdownQueue() throws IOException {
      for (MemcachedNode qa : nodesToShutdown) {
        if (!addedQueue.contains(qa)) {
          nodesToShutdown.remove(qa);
          metrics.decrementCounter(SHUTD_QUEUE_METRIC);
          Collection<Operation> notCompletedOperations = qa.destroyInputQueue();
          if (qa.getChannel() != null) {
            qa.getChannel().close();
            qa.setSk(null);
            if (qa.getBytesRemainingToWrite() > 0) {
              getLogger().warn("Shut down with %d bytes remaining to write",
                qa.getBytesRemainingToWrite());
            }
            getLogger().debug("Shut down channel %s", qa.getChannel());
          }
          redistributeOperations(notCompletedOperations);
        }
      }
    }
docs: Check if nodes need to be shut down and do so if needed.
  
  @throws IOException if the channel could not be closed properly.