public Admin getAdmin() throws IOException {
    ConnectionInfo connInfo = getCurrentConnection();
    if (connInfo.admin == null) {
      Lock lock = locker.acquireLock(getEffectiveUser());
      try {
        if (connInfo.admin == null) {
          connInfo.admin = connInfo.connection.getAdmin();
        }
      } finally {
        lock.unlock();
      }
    }
    return connInfo.admin;
  }
Caller doesn't close the admin afterwards. We need to manage it and close it properly.
hbase-server/src/main/java/org/apache/hadoop/hbase/util/ConnectionCache.java