@VisibleForTesting
  void dispatchResidualMessages() {
    List<ClientMessage> list = new ArrayList<>();
    try {
      // Clear the interrupt status if any,
      Thread.interrupted();
      int size = _messageQueue.size();
      list.addAll(uncheckedCast(_messageQueue.peek(size)));
      if (logger.isDebugEnabled()) {
        logger.debug(
            "{}: After flagging the dispatcher to stop , the residual List of messages to be dispatched={} size={}",
            this, list, list.size());
      }
      if (list.size() > 0) {
        long start = getStatistics().startTime();
        Iterator<ClientMessage> itr = list.iterator();
        while (itr.hasNext()) {
          dispatchMessage(itr.next());
          getStatistics().endMessage(start);
          itr.remove();
        }
        _messageQueue.remove();
      }
    } catch (CancelException e) {
      if (logger.isDebugEnabled()) {
        logger.debug("CacheClientNotifier stopped due to cancellation");
      }
    } catch (Exception e) {
      String extraMsg = null;

      if ("Broken pipe".equals(e.getMessage())) {
        extraMsg = "Problem caused by broken pipe on socket.";
      } else if (e instanceof RegionDestroyedException) {
        extraMsg = "Problem caused by message queue being closed.";
      }
      if (extraMsg == null) {
        extraMsg = "Problem caused by: " + e.getMessage();
      }
      logger.info(String.format(
          "%s Possibility of not being able to send some or all of the messages to clients. Total messages currently present in the list %s.",
          (!isStopped()) ? this + ": " : "", list.size()));
      logger.info(extraMsg);
    }

    if (!list.isEmpty() && logger.isTraceEnabled()) {
      logger.trace("Messages remaining in the list are: {}", list);
    }
  }
for old client, don't wait for re-auth but unregister this proxy completely.
geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/MessageDispatcher.java