You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2024/01/12 16:24:51 UTC
(camel) 02/03: CAMEL-20297 camel-base-engine: do not swallow interrupted exceptions
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit dc5bf5239c496b6d3cd4a40a645f1940ed5ebeb7
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Jan 12 10:57:52 2024 +0100
CAMEL-20297 camel-base-engine: do not swallow interrupted exceptions
---
.../java/org/apache/camel/impl/engine/BaseExecutorServiceManager.java | 1 +
.../org/apache/camel/impl/engine/DefaultAsyncProcessorAwaitManager.java | 2 ++
2 files changed, 3 insertions(+)
diff --git a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/BaseExecutorServiceManager.java b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/BaseExecutorServiceManager.java
index b543839cf79..47a7d1885f4 100644
--- a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/BaseExecutorServiceManager.java
+++ b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/BaseExecutorServiceManager.java
@@ -326,6 +326,7 @@ public class BaseExecutorServiceManager extends ServiceSupport implements Execut
}
}
} catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
warned = true;
LOG.warn("Forcing shutdown of ExecutorService: {} due interrupted.", executorService);
// we were interrupted during shutdown, so force shutdown
diff --git a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultAsyncProcessorAwaitManager.java b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultAsyncProcessorAwaitManager.java
index 650701f42a1..92983c1670a 100644
--- a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultAsyncProcessorAwaitManager.java
+++ b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultAsyncProcessorAwaitManager.java
@@ -110,6 +110,8 @@ public class DefaultAsyncProcessorAwaitManager extends ServiceSupport implements
}
} catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+
if (LOG.isTraceEnabled()) {
LOG.trace("Interrupted while waiting for callback, will continue routing exchangeId: {} -> {}",
exchange.getExchangeId(), exchange);