@Override
        public void run() {
            Process p = shell.process();
            try {
                p.exitValue();
            } catch (Exception e) {
                //Process has not terminated.
                //So check if it has completed
                //if not just destroy it.
                if (p != null && !shell.completed.get()) {
                    p.destroy();
                }
            }
        }
Timer which is used to timeout scripts spawned off by shell.
clients/src/main/java/org/apache/kafka/common/utils/Shell.java