private long purge(long lastPurgeTime) {
    long now = EnvironmentEdgeManager.currentTime();
    if (now < lastPurgeTime + this.simpleRpcServer.purgeTimeout) {
      return lastPurgeTime;
    }

    ArrayList<SimpleServerRpcConnection> conWithOldCalls = new ArrayList<>();
    // get the list of channels from list of keys.
    synchronized (writeSelector.keys()) {
      for (SelectionKey key : writeSelector.keys()) {
        SimpleServerRpcConnection connection = (SimpleServerRpcConnection) key.attachment();
        if (connection == null) {
          throw new IllegalStateException("Coding error: SelectionKey key without attachment.");
        }
        if (
          connection.lastSentTime > 0
            && now > connection.lastSentTime + this.simpleRpcServer.purgeTimeout
        ) {
          conWithOldCalls.add(connection);
        }
      }
    }

    // Seems safer to close the connection outside of the synchronized loop...
    for (SimpleServerRpcConnection connection : conWithOldCalls) {
      this.simpleRpcServer.closeConnection(connection);
    }

    return now;
  }
If there were some calls that have not been sent out for a long time, we close the connection.
@return the time of the purge.
hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcServerResponder.java