code: protected static void safeExecute(Runnable task) {
          try {
              task.run();
          } catch (Throwable t) {
              logger.warn("A task raised an exception. Task: {}", task, t);
          }
      }
docs: Try to execute the given {@link Runnable} and just log if it throws a {@link Throwable}.