public void shutdownAndWait(Duration grace, Duration die) {
        executor.shutdown();
        try {
            executor.awaitTermination(grace.toMillis(), TimeUnit.MILLISECONDS);
        }
        catch (InterruptedException e) {
            logger.log(Level.INFO, "Interrupted waiting for executor to complete", e);
        }
        if ( ! executor.isTerminated()) {
            executor.shutdownNow();
            try {
                executor.awaitTermination(die.toMillis(), TimeUnit.MILLISECONDS);
            }
            catch (InterruptedException e) {
                logger.log(Level.WARNING, "Interrupted waiting for executor to die", e);
            }
            if ( ! executor.isTerminated())
                throw new RuntimeException("Failed to shut down executor");
        }
    }
Shuts down the delegate executor and waits for the given grace duration for it to terminate.
If this fails, tells the executor to {@link ExecutorService#shutdownNow()}), and waits for the die duration.
vespajlib/src/main/java/com/yahoo/concurrent/StripedExecutor.java