private void detectOutlier(RequestLog log) {
        final RequestContext context = log.context();
        final ContextAwareEventLoop eventLoop = context.eventLoop();
        if (!eventLoop.inEventLoop()) {
            // Execute in the event loop to prevent a connection from being marked as an outlier as a request is
            // about to be sent.
            eventLoop.execute(() -> detectOutlier(log));
            return;
        }

        assert outlierRule != null;
        final OutlierDetectionDecision decision;
        try {
            decision = outlierRule.decide(context, log.responseHeaders(), log.responseCause());
        } catch (Exception e) {
            logger.warn("Unexpected exception from an OutlierDetectingRule: {}", outlierRule, e);
            return;
        }

        if (decision == null) {
            return;
        }
        assert outlierDetector != null;
        switch (decision) {
            // NEXT is assumed as SUCCESS.
            case SUCCESS:
            case NEXT:
                outlierDetector.onSuccess();
                if (outlierDetector.isOutlier()) {
                    // Although the last request succeeded luckily, we should see the total result in a window
                    // rather than just looking at one result.
                    markUnacquirable();
                }
                break;
            case FAILURE:
                outlierDetector.onFailure();
                if (outlierDetector.isOutlier()) {
                    markUnacquirable();
                }
                break;
            case FATAL:
                markUnacquirable();
                break;
            case IGNORE:
                break;
        }
    }
Tries to complete the {@link #sessionPromise} if the session is ready to serve.

@return {@code true} if the {@link #sessionPromise} has been completed successfully or exceptionally.
        {@code false} if the {@link #sessionPromise} is still incomplete.
core/src/main/java/com/linecorp/armeria/client/HttpSessionHandler.java