@Override
  public void close() {
    TraceUtil.trace(() -> {
      if (!closed.compareAndSet(false, true)) {
        return;
      }
      LOG.info("Connection has been closed by {}.", Thread.currentThread().getName());
      if (LOG.isDebugEnabled()) {
        logCallStack(Thread.currentThread().getStackTrace());
      }
      IOUtils.closeQuietly(clusterStatusListener,
        e -> LOG.warn("failed to close clusterStatusListener", e));
      IOUtils.closeQuietly(rpcClient, e -> LOG.warn("failed to close rpcClient", e));
      IOUtils.closeQuietly(registry, e -> LOG.warn("failed to close registry", e));
      synchronized (this) {
        if (choreService != null) {
          choreService.shutdown();
          choreService = null;
        }
      }
      if (metrics.isPresent()) {
        MetricsConnection.deleteMetricsConnection(metricsScope);
      }
      ConnectionOverAsyncConnection c = this.conn;
      if (c != null) {
        c.closePool();
      }
    }, "AsyncConnection.close");
  }
If choreService has not been created yet, create the ChoreService.
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java