private void onHealthCheckerUpdate(HealthChecker unused) {
        assert healthCheckerListener != null : "healthCheckerListener is null.";
        assert pendingHealthyResponses != null : "pendingHealthyResponses is null.";
        assert pendingUnhealthyResponses != null : "pendingUnhealthyResponses is null.";

        final boolean isHealthy = isHealthy();
        final PendingResponse[] pendingResponses;
        lock.lock();
        try {
            final Set<PendingResponse> set = isHealthy ? pendingHealthyResponses
                                                       : pendingUnhealthyResponses;
            if (!set.isEmpty()) {
                pendingResponses = set.toArray(EMPTY_PENDING_RESPONSES);
                set.clear();
            } else {
                pendingResponses = EMPTY_PENDING_RESPONSES;
            }
        } finally {
            lock.unlock();
        }

        final AggregatedHttpResponse res = getResponse(isHealthy);
        for (PendingResponse e : pendingResponses) {
            if (e.cancelAllScheduledFutures()) {
                if (e.method == HttpMethod.HEAD) {
                    if (e.res.tryWrite(res.headers())) {
                        e.res.close();
                    }
                } else {
                    e.res.close(res);
                }
            }
        }
    }
Extends the request timeout by the specified {@code longPollingTimeoutMillis}, because otherwise
the client will get {@code "503 Service Unavailable} due to a {@link RequestTimeoutException} before
long-polling finishes.
core/src/main/java/com/linecorp/armeria/server/healthcheck/HealthCheckService.java