From 3c7f64c8b0fdef092209418694aaac54ee7c43e5 Mon Sep 17 00:00:00 2001 From: Aleksey Genus Date: Wed, 7 Aug 2024 14:39:33 +0200 Subject: [PATCH] Use isShutdown() instead of isTerminated() to check if an executor shouldn't accept new tasks --- .../scheduling/concurrent/SimpleAsyncTaskScheduler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/SimpleAsyncTaskScheduler.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/SimpleAsyncTaskScheduler.java index 6e9ccd8ada5e..f19724de79ee 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/SimpleAsyncTaskScheduler.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/SimpleAsyncTaskScheduler.java @@ -227,7 +227,7 @@ private void shutdownAwareErrorHandler(Throwable ex) { if (this.errorHandler != null) { this.errorHandler.handleError(ex); } - else if (this.scheduledExecutor.isTerminated()) { + else if (this.scheduledExecutor.isShutdown()) { LogFactory.getLog(getClass()).debug("Ignoring scheduled task exception after shutdown", ex); } else {