private Runnable getWriterThreadRunnable(ServerName loadServer) {
    return () -> {
      try {
        Configuration conf = UTIL.getConfiguration();
        conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 5);
        try (Connection conn = ConnectionFactory.createConnection(conf);
          Table table = conn.getTableBuilder(TABLE_NAME, null)
            .setRequestAttribute("test", new byte[] { 0 }).build()) {
          // find the first region to exist on our test server, then submit requests to it
          for (HRegionLocation regionLocation : table.getRegionLocator().getAllRegionLocations()) {
            if (regionLocation.getServerName().equals(loadServer)) {
              submitRequestsToRegion(table, regionLocation.getRegion());
              return;
            }
          }
          throw new RuntimeException("Failed to find any regions for loadServer " + loadServer);
        }
      } catch (Exception e) {
        LOG.warn("Failed to load data", e);
        synchronized (THROWN_EXCEPTION) {
          THROWN_EXCEPTION.set(e);
          THROWN_EXCEPTION.notifyAll();
        }
      }
    };
  }
Tests that the logic in ServerRpcConnection works such that if the server is aborted, it short
circuits any other logic. This means we no longer even attempt to enqueue the request onto the
call queue. We verify this by using a special call queue which we can trigger to always return
CallQueueTooBigException. If the logic works, despite forcing those exceptions, we should not
see them.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerRejectDuringAbort.java