Program: 61103
Project: 61103
Buggy source:
private void testConnectionClose(boolean allowsInterrupt) throws Exception {
  TableName tableName=TableName.valueOf("String_Node_Str" + allowsInterrupt);
  TEST_UTIL.createTable(tableName,FAM_NAM).close();
  boolean previousBalance=TEST_UTIL.getAdmin().setBalancerRunning(false,true);
  Configuration c2=new Configuration(TEST_UTIL.getConfiguration());
  c2.set(HConstants.HBASE_CLIENT_INSTANCE_ID,String.valueOf(-1));
  c2.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,100);
  c2.setInt(HConstants.HBASE_CLIENT_PAUSE,1);
  c2.setInt(RpcClient.FAILED_SERVER_EXPIRY_KEY,0);
  c2.setBoolean(RpcClient.SPECIFIC_WRITE_THREAD,allowsInterrupt);
  Connection connection=ConnectionFactory.createConnection(c2);
  final Table table=connection.getTable(tableName);
  Put put=new Put(ROW);
  put.addColumn(FAM_NAM,ROW,ROW);
  table.put(put);
  final AtomicInteger step=new AtomicInteger(0);
  final AtomicReference<Throwable> failed=new AtomicReference<Throwable>(null);
  Thread t=new Thread("String_Node_Str"){
    @Override public void run(){
      int done=0;
      try {
        step.set(1);
        while (step.get() == 1) {
          Get get=new Get(ROW);
          table.get(get);
          done++;
          if (done % 100 == 0)           LOG.info("String_Node_Str" + done);
        }
      }
 catch (      Throwable t) {
        failed.set(t);
        LOG.error(t);
      }
      step.set(3);
    }
  }
;
  t.start();
  TEST_UTIL.waitFor(20000,new Waiter.Predicate<Exception>(){
    @Override public boolean evaluate() throws Exception {
      return step.get() == 1;
    }
  }
);
  ServerName sn;
  try (RegionLocator rl=connection.getRegionLocator(tableName)){
    sn=rl.getRegionLocation(ROW).getServerName();
  }
   ConnectionImplementation conn=(ConnectionImplementation)connection;
  RpcClient rpcClient=conn.getRpcClient();
  LOG.info("String_Node_Str" + conn.toString() + "String_Node_Str"+ sn);
  for (int i=0; i < 5000; i++) {
    rpcClient.cancelConnections(sn);
    Thread.sleep(5);
  }
  step.compareAndSet(1,2);
  TEST_UTIL.waitFor(40000,new Waiter.Predicate<Exception>(){
    @Override public boolean evaluate() throws Exception {
      return step.get() == 3;
    }
  }
);
  table.close();
  connection.close();
  Assert.assertTrue("String_Node_Str" + failed.get(),failed.get() == null);
  TEST_UTIL.getHBaseAdmin().setBalancerRunning(previousBalance,true);
}

Fixed version (ground truth):
private void testConnectionClose(boolean allowsInterrupt) throws Exception {
  TableName tableName=TableName.valueOf("String_Node_Str" + allowsInterrupt);
  TEST_UTIL.createTable(tableName,FAM_NAM).close();
  boolean previousBalance=TEST_UTIL.getAdmin().setBalancerRunning(false,true);
  Configuration c2=new Configuration(TEST_UTIL.getConfiguration());
  c2.set(HConstants.HBASE_CLIENT_INSTANCE_ID,String.valueOf(-1));
  c2.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,100);
  c2.setInt(HConstants.HBASE_CLIENT_PAUSE,1);
  c2.setInt(RpcClient.FAILED_SERVER_EXPIRY_KEY,0);
  c2.setBoolean(RpcClient.SPECIFIC_WRITE_THREAD,allowsInterrupt);
  c2.setInt(HConstants.HBASE_CLIENT_META_OPERATION_TIMEOUT,10000);
  c2.setInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT,10000);
  c2.setInt(HConstants.HBASE_RPC_TIMEOUT_KEY,5000);
  Connection connection=ConnectionFactory.createConnection(c2);
  final Table table=connection.getTable(tableName);
  Put put=new Put(ROW);
  put.addColumn(FAM_NAM,ROW,ROW);
  table.put(put);
  final AtomicInteger step=new AtomicInteger(0);
  final AtomicReference<Throwable> failed=new AtomicReference<Throwable>(null);
  Thread t=new Thread("String_Node_Str"){
    @Override public void run(){
      int done=0;
      try {
        step.set(1);
        while (step.get() == 1) {
          Get get=new Get(ROW);
          table.get(get);
          done++;
          if (done % 100 == 0)           LOG.info("String_Node_Str" + done);
          Thread.sleep(100);
        }
      }
 catch (      Throwable t) {
        failed.set(t);
        LOG.error(t);
      }
      step.set(3);
    }
  }
;
  t.start();
  TEST_UTIL.waitFor(20000,new Waiter.Predicate<Exception>(){
    @Override public boolean evaluate() throws Exception {
      return step.get() == 1;
    }
  }
);
  ServerName sn;
  try (RegionLocator rl=connection.getRegionLocator(tableName)){
    sn=rl.getRegionLocation(ROW).getServerName();
  }
   ConnectionImplementation conn=(ConnectionImplementation)connection;
  RpcClient rpcClient=conn.getRpcClient();
  LOG.info("String_Node_Str" + conn.toString() + "String_Node_Str"+ sn);
  for (int i=0; i < 5000; i++) {
    rpcClient.cancelConnections(sn);
    Thread.sleep(5);
  }
  step.compareAndSet(1,2);
  TEST_UTIL.waitFor(40000,new Waiter.Predicate<Exception>(){
    @Override public boolean evaluate() throws Exception {
      return step.get() == 3;
    }
  }
);
  table.close();
  connection.close();
  Assert.assertTrue("String_Node_Str" + failed.get(),failed.get() == null);
  TEST_UTIL.getHBaseAdmin().setBalancerRunning(previousBalance,true);
}