public void shutDown() {
        synchronized (this) {
            this.running = false;
            notifyAll();
        }

        try {
            join();
        } catch (InterruptedException e) {
            log.warn(
                    "Interrupted during graceful shutdown; will interrupt health check thread "
                            + "and then return immediately without waiting for thread to terminate",
                    e
            );
            this.interrupt();
            // Preserve the interrupt status in case later operations block too
            Thread.currentThread().interrupt();
        }
    }
Trigger shutdown of the thread, stop accepting new callbacks via {@link #check(Callback)},
and await the termination of the thread.
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/standalone/HealthCheckThread.java