public synchronized void stop() { if (discoveryConfig.isEnabled()) { if (discoveryThread == null) { LOG.warn("Client was never started!"); } else { discoveryThread.interrupt(); try { discoveryThread.join(discoveryConfig.getZookeeperTimeout().getMillis()); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); } LOG.info("Stopped Discovery client"); } } } }
if (!latch.await(discoveryConfig.getZookeeperTimeout().getMillis(), TimeUnit.MILLISECONDS)) { LOG.warn("Timeout waiting for callbacks, some nodes were not parsed.");