code: @Override
      public void closeAllClientTransports(DestroyHook destroyHook) {
          // 清空所有列表,不让再调了
          Map<ProviderInfo, ClientTransport> all = clearProviders();
          if (destroyHook != null) {
              try {
                  destroyHook.preDestroy();
              } catch (Exception e) {
                  if (LOGGER.isWarnEnabled(consumerConfig.getAppName())) {
                      LOGGER.warnWithApp(consumerConfig.getAppName(), e.getMessage(), e);
                  }
              }
          }
          // 多线程销毁已经建立的连接
          int providerSize = all.size();
          if (providerSize > 0) {
              int timeout = consumerConfig.getDisconnectTimeout();
              int threads = Math.min(10, providerSize); // 最大10个
              final CountDownLatch latch = new CountDownLatch(providerSize);
              ThreadPoolExecutor closePool = new ThreadPoolExecutor(threads, threads,
                  0L, TimeUnit.MILLISECONDS,
                  new LinkedBlockingQueue<Runnable>(providerSize),
                  new NamedThreadFactory("CLI-DISCONN-" + consumerConfig.getInterfaceId(), true));
              for (Map.Entry<ProviderInfo, ClientTransport> entry : all.entrySet()) {
                  final ProviderInfo providerInfo = entry.getKey();
                  final ClientTransport transport = entry.getValue();
                  closePool.execute(new Runnable() {
                      @Override
                      public void run() {
                          try {
                              ClientTransportFactory.releaseTransport(transport, 0);
                          } catch (Exception e) {
                              if (LOGGER.isWarnEnabled(consumerConfig.getAppName())) {
                                  LOGGER.warnWithApp(consumerConfig.getAppName(),
                                      "catch exception but ignore it when close alive client : {}", providerInfo);
                              }
                          } finally {
                              latch.countDown();
                          }
                      }
                  });
              }
              try {
                  int totalTimeout = ((providerSize % threads == 0) ? (providerSize / threads) : ((providerSize /
                      threads) + 1)) * timeout + 500;
                  latch.await(totalTimeout, TimeUnit.MILLISECONDS); // 一直等到
              } catch (InterruptedException e) {
                  LOGGER.errorWithApp(consumerConfig.getAppName(), "Exception when close transport", e);
              } finally {
                  closePool.shutdown();
              }
          }
      }
docs: 销毁全部连接
  
  @param destroyHook 销毁钩子