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/09 12:27:12 UTC

(camel) branch main updated (1634af20645 -> f70676d71fd)

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 1634af20645 CAMEL-20231: use an unmodifiable list instead of copying the old one
     new f30b9162057 CAMEL-20297 camel-as2: do not swallow interrupted exceptions
     new 33153f080a4 CAMEL-20297 camel-controlbus: do not swallow interrupted exceptions
     new 1fe5f138249 CAMEL-20297 camel-direct: do not swallow interrupted exceptions
     new 7689bc302bf CAMEL-20297 camel-disruptor: do not swallow interrupted exceptions
     new f70676d71fd CAMEL-20297 camel-irc: do not swallow interrupted exceptions

The 5 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:
 .../java/org/apache/camel/component/as2/api/AS2ClientManager.java  | 5 ++++-
 .../org/apache/camel/component/controlbus/ControlBusProducer.java  | 3 ++-
 .../java/org/apache/camel/component/direct/DirectProducer.java     | 7 +++++++
 .../org/apache/camel/component/disruptor/DisruptorProducer.java    | 6 ++++--
 .../org/apache/camel/component/disruptor/DisruptorReference.java   | 6 ++++--
 .../src/main/java/org/apache/camel/component/irc/IrcConsumer.java  | 3 ++-
 .../src/main/java/org/apache/camel/component/irc/IrcProducer.java  | 3 ++-
 7 files changed, 25 insertions(+), 8 deletions(-)


(camel) 05/05: CAMEL-20297 camel-irc: 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 f70676d71fde83c05871742a8dbb1f2356a9270c
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Jan 9 11:54:32 2024 +0000

    CAMEL-20297 camel-irc: do not swallow interrupted exceptions
---
 .../src/main/java/org/apache/camel/component/irc/IrcConsumer.java      | 3 ++-
 .../src/main/java/org/apache/camel/component/irc/IrcProducer.java      | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConsumer.java b/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConsumer.java
index b6cf0b30324..cdc6b22ea2f 100644
--- a/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConsumer.java
+++ b/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConsumer.java
@@ -66,7 +66,8 @@ public class IrcConsumer extends DefaultConsumer {
         try {
             Thread.sleep(configuration.getCommandTimeout());
         } catch (InterruptedException ex) {
-            // ignore
+            LOG.info("Interrupted while sleeping before sending commands");
+            Thread.currentThread().interrupt();
         }
         if (ObjectHelper.isNotEmpty(configuration.getNickPassword())) {
             LOG.debug("Identifying and enforcing nick with NickServ.");
diff --git a/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcProducer.java b/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcProducer.java
index b9c5a3a8bb5..7026a263fa1 100644
--- a/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcProducer.java
+++ b/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcProducer.java
@@ -99,7 +99,8 @@ public class IrcProducer extends DefaultProducer {
         try {
             Thread.sleep(getEndpoint().getConfiguration().getCommandTimeout());
         } catch (InterruptedException ex) {
-            // ignore
+            LOG.info("Interrupted while sleeping before sending commands");
+            Thread.currentThread().interrupt();
         }
         getEndpoint().joinChannels();
     }


(camel) 03/05: CAMEL-20297 camel-direct: 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 1fe5f138249f1ac6d17cdb24eb6490fca3526742
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Jan 9 11:54:11 2024 +0000

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

diff --git a/components/camel-direct/src/main/java/org/apache/camel/component/direct/DirectProducer.java b/components/camel-direct/src/main/java/org/apache/camel/component/direct/DirectProducer.java
index e441881de72..714d00e673e 100644
--- a/components/camel-direct/src/main/java/org/apache/camel/component/direct/DirectProducer.java
+++ b/components/camel-direct/src/main/java/org/apache/camel/component/direct/DirectProducer.java
@@ -96,6 +96,13 @@ public class DirectProducer extends DefaultAsyncProducer {
                     return consumer.getAsyncProcessor().process(exchange, callback);
                 }
             }
+        } catch (InterruptedException e) {
+            LOG.info("Interrupted while processing the exchange");
+            Thread.currentThread().interrupt();
+
+            exchange.setException(e);
+            callback.done(true);
+            return true;
         } catch (Exception e) {
             exchange.setException(e);
             callback.done(true);


(camel) 04/05: CAMEL-20297 camel-disruptor: 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 7689bc302bf0ed21e4cdccdbc1ec7db7cbc6bd3d
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Jan 9 11:54:23 2024 +0000

    CAMEL-20297 camel-disruptor: do not swallow interrupted exceptions
---
 .../org/apache/camel/component/disruptor/DisruptorProducer.java     | 6 ++++--
 .../org/apache/camel/component/disruptor/DisruptorReference.java    | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/components/camel-disruptor/src/main/java/org/apache/camel/component/disruptor/DisruptorProducer.java b/components/camel-disruptor/src/main/java/org/apache/camel/component/disruptor/DisruptorProducer.java
index a778869e6a1..89348a8ed82 100644
--- a/components/camel-disruptor/src/main/java/org/apache/camel/component/disruptor/DisruptorProducer.java
+++ b/components/camel-disruptor/src/main/java/org/apache/camel/component/disruptor/DisruptorProducer.java
@@ -100,7 +100,8 @@ public class DisruptorProducer extends DefaultAsyncProducer {
                 try {
                     done = latch.await(timeout, TimeUnit.MILLISECONDS);
                 } catch (InterruptedException e) {
-                    // ignore
+                    LOG.info("Interrupted while waiting for the task to complete");
+                    Thread.currentThread().interrupt();
                 }
                 if (!done) {
                     // Remove timed out Exchange from disruptor endpoint.
@@ -127,7 +128,8 @@ public class DisruptorProducer extends DefaultAsyncProducer {
                 try {
                     latch.await();
                 } catch (InterruptedException e) {
-                    // ignore
+                    LOG.info("Interrupted while waiting for the task to complete");
+                    Thread.currentThread().interrupt();
                 }
             }
         } else {
diff --git a/components/camel-disruptor/src/main/java/org/apache/camel/component/disruptor/DisruptorReference.java b/components/camel-disruptor/src/main/java/org/apache/camel/component/disruptor/DisruptorReference.java
index 6331b727c0e..3922fe8a3e0 100644
--- a/components/camel-disruptor/src/main/java/org/apache/camel/component/disruptor/DisruptorReference.java
+++ b/components/camel-disruptor/src/main/java/org/apache/camel/component/disruptor/DisruptorReference.java
@@ -178,7 +178,8 @@ public class DisruptorReference {
                     }
                     eventHandlerStarted = true;
                 } catch (InterruptedException e) {
-                    //just retry
+                    LOGGER.info("Interrupted while waiting for the startup to complete");
+                    Thread.currentThread().interrupt();
                 }
             }
         }
@@ -317,7 +318,8 @@ public class DisruptorReference {
                         }
                         eventHandlerFinished = true;
                     } catch (InterruptedException e) {
-                        //just retry
+                        LOGGER.info("Interrupted while waiting for the shutdown to complete");
+                        Thread.currentThread().interrupt();
                     }
                 }
             }


(camel) 01/05: CAMEL-20297 camel-as2: 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 f30b9162057d4b975e00a244c51bfba982cbe6fe
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Jan 9 11:53:45 2024 +0000

    CAMEL-20297 camel-as2: do not swallow interrupted exceptions
---
 .../java/org/apache/camel/component/as2/api/AS2ClientManager.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/AS2ClientManager.java b/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/AS2ClientManager.java
index 64a87e92e76..9ae7c8d9195 100644
--- a/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/AS2ClientManager.java
+++ b/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/AS2ClientManager.java
@@ -392,7 +392,10 @@ public class AS2ClientManager {
             EntityParser.parseAS2MessageEntity(response);
         } catch (IOException e) {
             throw new HttpException("Failed to send http request message", e);
-        } catch (ExecutionException | InterruptedException ex) {
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new HttpException("Interrupted while sending the http request", e);
+        } catch (ExecutionException ex) {
             throw new HttpException("Retrieving connection from Pool failed or timed out", ex);
         }
         httpContext.setAttribute(HTTP_RESPONSE, response);


(camel) 02/05: CAMEL-20297 camel-controlbus: 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 33153f080a4bdb896248f1dc966062bd46471986
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Jan 9 11:53:59 2024 +0000

    CAMEL-20297 camel-controlbus: do not swallow interrupted exceptions
---
 .../java/org/apache/camel/component/controlbus/ControlBusProducer.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/components/camel-controlbus/src/main/java/org/apache/camel/component/controlbus/ControlBusProducer.java b/components/camel-controlbus/src/main/java/org/apache/camel/component/controlbus/ControlBusProducer.java
index 9e7ce0508b4..9838263945a 100644
--- a/components/camel-controlbus/src/main/java/org/apache/camel/component/controlbus/ControlBusProducer.java
+++ b/components/camel-controlbus/src/main/java/org/apache/camel/component/controlbus/ControlBusProducer.java
@@ -191,7 +191,8 @@ public class ControlBusProducer extends DefaultAsyncProducer {
                             LOG.debug("Sleeping {} ms before starting route: {}", delay, id);
                             Thread.sleep(delay);
                         } catch (InterruptedException e) {
-                            // ignore
+                            LOG.info("Interrupted while waiting before starting the route");
+                            Thread.currentThread().interrupt();
                         }
                     }
                     getEndpoint().getCamelContext().getRouteController().startRoute(id);