public static void warnIfNotInEventLoop(EventLoop loop) {
    assert loop.inEventLoop();
    if (!loop.inEventLoop()) {
      Exception exception = new IllegalStateException(
          "Execution is not in the expected event loop. Please report this issue to the "
              + "AWS SDK for Java team on GitHub, because it could result in race conditions.");
      log.warn("Execution is happening outside of the expected event loop.", exception);
    }
  }
Runs a task in the given {@link EventExecutor}. Runs immediately if the current thread is in the
eventExecutor. Notifies the given {@link Promise} if a failure occurs.

@param eventExecutor Executor to run task in.
@param runnable Task to run.
@param promise Promise to notify if failure occurs.
ambry-commons/src/main/java/com/github/ambry/commons/NettyUtils.java