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/08 16:10:22 UTC

(camel) branch main updated (d4c535e5fa7 -> 07db1966e1c)

This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


    from d4c535e5fa7 Camel-Robotframework: Fixed typo in docs (#12696)
     new b00051f5f7c CAMEL-20297 camel-file-watch: do not swallow interrupted exceptions
     new 56327a735c0 CAMEL-20297 camel-kafka: do not swallow interrupted exceptions
     new 80921f085bd CAMEL-20297 camel-rocketmq: do not swallow interrupted exceptions
     new 1c73ce90679 CAMEL-20297 camel-seda: do not swallow interrupted exceptions
     new de350b2ac28 CAMEL-20297 camel-stream: do not swallow interrupted exceptions
     new 07db1966e1c CAMEL-20297 camel-test: do not swallow interrupted exceptions

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/camel/component/file/watch/FileWatchConsumer.java  |  1 +
 .../processor/idempotent/kafka/KafkaIdempotentRepository.java | 11 ++++++++---
 .../org/apache/camel/component/rocketmq/RocketMQProducer.java |  5 +++++
 .../java/org/apache/camel/component/seda/SedaConsumer.java    |  5 ++++-
 .../java/org/apache/camel/component/seda/SedaProducer.java    |  8 ++++----
 .../org/apache/camel/component/stream/StreamProducer.java     |  3 +++
 .../main/java/org/apache/camel/test/junit5/TestSupport.java   |  2 +-
 7 files changed, 26 insertions(+), 9 deletions(-)


(camel) 05/06: CAMEL-20297 camel-stream: do not swallow interrupted exceptions

Posted by or...@apache.org.
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 de350b2ac2814314f1786b47011824326181fb89
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Jan 5 11:20:31 2024 +0100

    CAMEL-20297 camel-stream: do not swallow interrupted exceptions
---
 .../main/java/org/apache/camel/component/stream/StreamProducer.java    | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
index 70bb0d48708..77b0e7d5298 100644
--- a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
+++ b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
@@ -78,6 +78,9 @@ public class StreamProducer extends DefaultAsyncProducer {
                     closeStream(exchange, false);
                 }
             }
+        } catch (InterruptedException e) {
+            exchange.setException(e);
+            Thread.currentThread().interrupt();
         } catch (Exception e) {
             exchange.setException(e);
         }


(camel) 03/06: CAMEL-20297 camel-rocketmq: do not swallow interrupted exceptions

Posted by or...@apache.org.
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 80921f085bd7dc727b98c17423ec4e7ef9b2fff0
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Jan 5 11:19:47 2024 +0100

    CAMEL-20297 camel-rocketmq: do not swallow interrupted exceptions
---
 .../java/org/apache/camel/component/rocketmq/RocketMQProducer.java   | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/components/camel-rocketmq/src/main/java/org/apache/camel/component/rocketmq/RocketMQProducer.java b/components/camel-rocketmq/src/main/java/org/apache/camel/component/rocketmq/RocketMQProducer.java
index e64305ff941..a07006f7695 100644
--- a/components/camel-rocketmq/src/main/java/org/apache/camel/component/rocketmq/RocketMQProducer.java
+++ b/components/camel-rocketmq/src/main/java/org/apache/camel/component/rocketmq/RocketMQProducer.java
@@ -79,6 +79,11 @@ public class RocketMQProducer extends DefaultAsyncProducer {
             } else {
                 return processInOnly(exchange, callback);
             }
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            exchange.setException(e);
+            callback.done(true);
+            return true;
         } catch (Exception e) {
             exchange.setException(e);
             callback.done(true);


(camel) 06/06: CAMEL-20297 camel-test: do not swallow interrupted exceptions

Posted by or...@apache.org.
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 07db1966e1c38e68202eed1386acdd8d50738300
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Jan 5 11:21:38 2024 +0100

    CAMEL-20297 camel-test: do not swallow interrupted exceptions
---
 .../src/main/java/org/apache/camel/test/junit5/TestSupport.java         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/TestSupport.java b/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/TestSupport.java
index 4a0e90f3182..dbdb99fc5a7 100644
--- a/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/TestSupport.java
+++ b/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/TestSupport.java
@@ -464,7 +464,7 @@ public final class TestSupport {
                 try {
                     Thread.sleep(1000);
                 } catch (InterruptedException e) {
-                    // Ignore
+                    Thread.currentThread().interrupt();
                 }
             }
         }


(camel) 02/06: CAMEL-20297 camel-kafka: do not swallow interrupted exceptions

Posted by or...@apache.org.
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 56327a735c004f14136d90f1c565215c5aedcd0a
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Jan 5 11:19:38 2024 +0100

    CAMEL-20297 camel-kafka: do not swallow interrupted exceptions
---
 .../processor/idempotent/kafka/KafkaIdempotentRepository.java | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/components/camel-kafka/src/main/java/org/apache/camel/processor/idempotent/kafka/KafkaIdempotentRepository.java b/components/camel-kafka/src/main/java/org/apache/camel/processor/idempotent/kafka/KafkaIdempotentRepository.java
index 2169815777d..84257097d00 100644
--- a/components/camel-kafka/src/main/java/org/apache/camel/processor/idempotent/kafka/KafkaIdempotentRepository.java
+++ b/components/camel-kafka/src/main/java/org/apache/camel/processor/idempotent/kafka/KafkaIdempotentRepository.java
@@ -363,7 +363,8 @@ public class KafkaIdempotentRepository extends ServiceSupport implements Idempot
                         topic);
             }
         } catch (InterruptedException e) {
-            log.warn("Interrupted while warming up cache. This exception is ignored.", e);
+            log.warn("Interrupted while warming up cache.", e);
+            Thread.currentThread().interrupt();
         }
     }
 
@@ -378,7 +379,8 @@ public class KafkaIdempotentRepository extends ServiceSupport implements Idempot
                 log.warn("Timeout waiting for cache to shutdown from topic {}. Proceeding anyway.", topic);
             }
         } catch (InterruptedException e) {
-            log.warn("Interrupted waiting on shutting down cache due {}. This exception is ignored.", e.getMessage());
+            log.warn("Interrupted waiting on shutting down cache due {}.", e.getMessage());
+            Thread.currentThread().interrupt();
         }
         camelContext.getExecutorServiceManager().shutdown(executorService);
 
@@ -406,7 +408,10 @@ public class KafkaIdempotentRepository extends ServiceSupport implements Idempot
             ObjectHelper.notNull(producer, "producer");
 
             producer.send(new ProducerRecord<>(topic, key, action.toString())).get(); // sync send
-        } catch (ExecutionException | InterruptedException e) {
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new RuntimeCamelException(e);
+        } catch (ExecutionException e) {
             throw new RuntimeCamelException(e);
         }
     }


(camel) 04/06: CAMEL-20297 camel-seda: do not swallow interrupted exceptions

Posted by or...@apache.org.
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 1c73ce90679ab0cc5e5bdb36b4e221462af7ef56
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Jan 5 11:19:53 2024 +0100

    CAMEL-20297 camel-seda: do not swallow interrupted exceptions
---
 .../main/java/org/apache/camel/component/seda/SedaConsumer.java   | 5 ++++-
 .../main/java/org/apache/camel/component/seda/SedaProducer.java   | 8 ++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaConsumer.java b/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
index 1cc1964e84b..1f04eded390 100644
--- a/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
+++ b/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
@@ -102,7 +102,7 @@ public class SedaConsumer extends DefaultConsumer implements Runnable, ShutdownA
             try {
                 latch.await();
             } catch (InterruptedException e) {
-                // ignore
+                Thread.currentThread().interrupt();
             }
         }
     }
@@ -147,6 +147,7 @@ public class SedaConsumer extends DefaultConsumer implements Runnable, ShutdownA
                     Thread.sleep(Math.min(pollTimeout, 1000));
                 } catch (InterruptedException e) {
                     LOG.debug("Sleep interrupted, are we stopping? {}", isStopping() || isStopped());
+                    Thread.currentThread().interrupt();
                 }
                 continue;
             }
@@ -165,6 +166,7 @@ public class SedaConsumer extends DefaultConsumer implements Runnable, ShutdownA
                         Thread.sleep(Math.min(pollTimeout, 1000));
                     } catch (InterruptedException e) {
                         LOG.debug("Sleep interrupted, are we stopping? {}", isStopping() || isStopped());
+                        Thread.currentThread().interrupt();
                     }
                     continue;
                 }
@@ -201,6 +203,7 @@ public class SedaConsumer extends DefaultConsumer implements Runnable, ShutdownA
                 }
             } catch (InterruptedException e) {
                 LOG.debug("Sleep interrupted, are we stopping? {}", isStopping() || isStopped());
+                Thread.currentThread().interrupt();
                 continue;
             } catch (Exception e) {
                 if (exchange != null) {
diff --git a/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaProducer.java b/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaProducer.java
index 7d6761e7dc7..c9f0ad6e99a 100644
--- a/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaProducer.java
+++ b/components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaProducer.java
@@ -122,7 +122,7 @@ public class SedaProducer extends DefaultAsyncProducer {
                 try {
                     done = latch.await(timeout, TimeUnit.MILLISECONDS);
                 } catch (InterruptedException e) {
-                    // ignore
+                    Thread.currentThread().interrupt();
                 }
                 if (!done) {
                     exchange.setException(new ExchangeTimedOutException(exchange, timeout));
@@ -139,7 +139,7 @@ public class SedaProducer extends DefaultAsyncProducer {
                 try {
                     latch.await();
                 } catch (InterruptedException e) {
-                    // ignore
+                    Thread.currentThread().interrupt();
                 }
             }
         } else {
@@ -222,15 +222,15 @@ public class SedaProducer extends DefaultAsyncProducer {
                     LOG.trace("Discarding Exchange as queue is full: {}", target);
                 }
             } catch (InterruptedException e) {
-                // ignore
                 LOG.debug("Offer interrupted, are we stopping? {}", isStopping() || isStopped());
+                Thread.currentThread().interrupt();
             }
         } else if (blockWhenFull && offerTimeout == 0) {
             try {
                 queue.put(target);
             } catch (InterruptedException e) {
-                // ignore
                 LOG.debug("Put interrupted, are we stopping? {}", isStopping() || isStopped());
+                Thread.currentThread().interrupt();
             }
         } else if (blockWhenFull && offerTimeout > 0) {
             try {


(camel) 01/06: CAMEL-20297 camel-file-watch: do not swallow interrupted exceptions

Posted by or...@apache.org.
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 b00051f5f7c94feaffe800ed1184e2412e5ece5a
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Jan 5 10:35:06 2024 +0100

    CAMEL-20297 camel-file-watch: do not swallow interrupted exceptions
---
 .../java/org/apache/camel/component/file/watch/FileWatchConsumer.java    | 1 +
 1 file changed, 1 insertion(+)

diff --git a/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchConsumer.java b/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchConsumer.java
index d548f16543d..111f51e8c48 100644
--- a/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchConsumer.java
+++ b/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchConsumer.java
@@ -244,6 +244,7 @@ public class FileWatchConsumer extends DefaultConsumer {
                 try {
                     event = eventQueue.poll(1000, TimeUnit.MILLISECONDS);
                 } catch (InterruptedException e) {
+                    Thread.currentThread().interrupt();
                     return;
                 }