private boolean isNonRestart(Throwable e) {
        if (e instanceof BatchNoRestartError) {
            return true;
        }
        Throwable cause = e.getCause();
        return cause != null && isNonRestart(cause);
    }
This is used instead of awaitTermination(), because that interrupts
the thread and then waits for its termination.  This politely waits.

@param causeForTermination reason for termination.
tika-batch/src/main/java/org/apache/tika/batch/BatchProcess.java