Program: 61042
Project: 61042
Buggy source:
@Test(timeout=30000) public void testLockLeakWithDelta() throws Exception, Throwable {
  final TableName tableName=TableName.valueOf(name.getMethodName());
  HTableDescriptor desc=new HTableDescriptor(tableName);
  desc.addCoprocessor(WaitingForMultiMutationsObserver.class.getName());
  desc.setConfiguration("String_Node_Str",String.valueOf(5000));
  desc.addFamily(new HColumnDescriptor(FAMILY));
  TEST_UTIL.getAdmin().createTable(desc);
  Configuration copy=new Configuration(TEST_UTIL.getConfiguration());
  copy.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,2);
  try (Connection con=ConnectionFactory.createConnection(copy)){
    HRegion region=(HRegion)find(tableName);
    region.setTimeoutForWriteLock(10);
    ExecutorService putService=Executors.newSingleThreadExecutor();
    putService.execute(() -> {
      try (Table table=con.getTable(tableName)){
        Put put=new Put(ROW);
        put.addColumn(FAMILY,QUALIFIER,VALUE);
        table.put(put);
      }
 catch (      IOException ex) {
        throw new RuntimeException(ex);
      }
    }
);
    ExecutorService appendService=Executors.newSingleThreadExecutor();
    appendService.execute(() -> {
      Append append=new Append(ROW);
      append.addColumn(FAMILY,QUALIFIER,VALUE);
      try (Table table=con.getTable(tableName)){
        table.append(append);
        fail("String_Node_Str");
      }
 catch (      Throwable ex) {
      }
    }
);
    appendService.shutdown();
    appendService.awaitTermination(Long.MAX_VALUE,TimeUnit.DAYS);
    WaitingForMultiMutationsObserver observer=find(tableName,WaitingForMultiMutationsObserver.class);
    observer.latch.countDown();
    putService.shutdown();
    putService.awaitTermination(Long.MAX_VALUE,TimeUnit.DAYS);
    try (Table table=con.getTable(tableName)){
      Result r=table.get(new Get(ROW));
      assertFalse(r.isEmpty());
      assertTrue(Bytes.equals(r.getValue(FAMILY,QUALIFIER),VALUE));
    }
   }
   HRegion region=(HRegion)find(tableName);
  int readLockCount=region.getReadLockCount();
  LOG.info("String_Node_Str" + readLockCount);
  assertEquals(0,readLockCount);
}

Fixed version (ground truth):
@Test(timeout=30000) public void testLockLeakWithDelta() throws Exception, Throwable {
  final TableName tableName=TableName.valueOf(name.getMethodName());
  HTableDescriptor desc=new HTableDescriptor(tableName);
  desc.addCoprocessor(WaitingForMultiMutationsObserver.class.getName());
  desc.setConfiguration("String_Node_Str",String.valueOf(5000));
  desc.addFamily(new HColumnDescriptor(FAMILY));
  TEST_UTIL.getAdmin().createTable(desc);
  Configuration copy=new Configuration(TEST_UTIL.getConfiguration());
  copy.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,2);
  try (Connection con=ConnectionFactory.createConnection(copy)){
    HRegion region=(HRegion)find(tableName);
    region.setTimeoutForWriteLock(10);
    ExecutorService putService=Executors.newSingleThreadExecutor();
    putService.execute(() -> {
      try (Table table=con.getTable(tableName)){
        Put put=new Put(ROW);
        put.addColumn(FAMILY,QUALIFIER,VALUE);
        table.put(put);
      }
 catch (      IOException ex) {
        throw new RuntimeException(ex);
      }
    }
);
    ExecutorService appendService=Executors.newSingleThreadExecutor();
    appendService.execute(() -> {
      Append append=new Append(ROW);
      append.addColumn(FAMILY,QUALIFIER,VALUE);
      try (Table table=con.getTable(tableName)){
        table.append(append);
        fail("String_Node_Str");
      }
 catch (      Exception ex) {
      }
    }
);
    appendService.shutdown();
    appendService.awaitTermination(Long.MAX_VALUE,TimeUnit.DAYS);
    WaitingForMultiMutationsObserver observer=find(tableName,WaitingForMultiMutationsObserver.class);
    observer.latch.countDown();
    putService.shutdown();
    putService.awaitTermination(Long.MAX_VALUE,TimeUnit.DAYS);
    try (Table table=con.getTable(tableName)){
      Result r=table.get(new Get(ROW));
      assertFalse(r.isEmpty());
      assertTrue(Bytes.equals(r.getValue(FAMILY,QUALIFIER),VALUE));
    }
   }
   HRegion region=(HRegion)find(tableName);
  int readLockCount=region.getReadLockCount();
  LOG.info("String_Node_Str" + readLockCount);
  assertEquals(0,readLockCount);
}