public void shutdown() {
        closed.set(true);
        synchronized (this) {
            nodeMonitors.clear();
        }
        synchronized (nodeManager) {
            skipNextWait = true;
            nodeManager.notifyAll();
        }
        try {
            if (monitorThread.isAlive()) {
                monitorThread.join();
            }
        } catch (InterruptedException e) {}
    }
Must be called when this goes out of use
container-search/src/main/java/com/yahoo/search/cluster/ClusterMonitor.java