public void waitForTerminate() {
        // stop running threads.
        if (isRunnable()) {
            stopRunningThreads();
        }
    }
Stop thread pool and running threads if they're in the running state.
inlong-agent/agent-common/src/main/java/org/apache/inlong/agent/common/AbstractDaemon.java