code: public static void shutdownExecutor(ExecutorService executor, final String name)
      {
          executor.shutdown();
          try {
              log.info("Waiting for %s to shutdown", name);
              if (!executor.awaitTermination(5, TimeUnit.SECONDS)) {
                  log.warn("%s did not shutdown properly", name);
              }
          }
          catch (InterruptedException e) {
              log.warn("Interrupted while waiting for %s to shutdown", name);
              Thread.currentThread().interrupt();
          }
      }
docs: TODO : make wait time configurable ?