Skip to content

Commit

Permalink
Add Warning Log for 503 Responses Due to Thread Pool Exhaustion
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cescoffier committed May 7, 2024
1 parent 5fbf0b6 commit e58595b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e58595b

Please sign in to comment.