From e58595b2d5ec949d61f441a57835d73deeee91be Mon Sep 17 00:00:00 2001 From: Clement Escoffier Date: Tue, 7 May 2024 08:47:03 +0200 Subject: [PATCH] Add Warning Log for 503 Responses Due to Thread Pool Exhaustion This commit introduces a warning log message when a 503 response is returned due to thread pool exhaustion. Previously, no server-side log was generated in such scenarios. The log message is categorized as a warning, as this is not an exceptional situation. Despite the thread pool exhaustion, reactive endpoints and virtual threads can still operate successfully. --- .../io/quarkus/vertx/http/runtime/QuarkusErrorHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/QuarkusErrorHandler.java b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/QuarkusErrorHandler.java index a08fa7c6fd26b..6d2a61a2851a4 100644 --- a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/QuarkusErrorHandler.java +++ b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/QuarkusErrorHandler.java @@ -96,7 +96,8 @@ public void accept(Throwable throwable) { } if (event.failure() instanceof RejectedExecutionException) { - // No more worker threads - return a 503 + log.warn( + "Worker thread pool exhaustion, no more worker threads available - returning a `503 - SERVICE UNAVAILABLE` response."); event.response().setStatusCode(HttpResponseStatus.SERVICE_UNAVAILABLE.code()).end(); return; }