code: public void shutdown() {
      gossipServiceRunning.set(false);
      gossipThreadExecutor.shutdown();
      if (passiveGossipThread != null) {
        passiveGossipThread.shutdown();
      }
      if (activeGossipThread != null) {
        activeGossipThread.shutdown();
      }
      try {
        boolean result = gossipThreadExecutor.awaitTermination(1000, TimeUnit.MILLISECONDS);
        if (!result) {
          LOGGER.error("executor shutdown timed out");
        }
      } catch (InterruptedException e) {
        LOGGER.error(e);
      }
    }
docs: Shutdown the gossip service.