private Mono<Void> cleanup(@Nullable Throwable cause) {
        if (future.isDone()) {
            return Mono.empty();
        }

        if (cause != null) {
            future.completeExceptionally(cause);
            logger.debug("{} Response future has been completed with a cause", ctx, cause);
            return Mono.empty();
        }

        final HttpResponse response = HttpResponse.of(armeriaHeaders.build());
        future.complete(response);
        logger.debug("{} Response future has been completed with an HttpResponse", ctx);

        return Mono.fromFuture(response.whenComplete())
                   .onErrorResume(CancelledSubscriptionException.class, e -> Mono.empty());
    }
Closes the {@link HttpResponseWriter} if it is opened.
spring/boot3-webflux-autoconfigure/src/main/java/com/linecorp/armeria/spring/web/reactive/ArmeriaServerHttpResponse.java