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/10 07:49:29 UTC

(camel) branch main updated (74b6e1994a3 -> 9a4bb60bcc4)

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 74b6e1994a3 CAMEL-20231: clear the services on initialization (#12722)
     new 9e173007798 CAMEL-20297 camel-aws2-athena: do not swallow interrupted exceptions
     new 9a4bb60bcc4 CAMEL-20297 camel-aws2-kinesis: do not swallow interrupted exceptions

The 2 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:
 .../component/aws2/athena/Athena2QueryHelper.java  |  2 ++
 .../component/aws2/kinesis/Kinesis2Consumer.java   | 27 +++++++++++++++++-----
 2 files changed, 23 insertions(+), 6 deletions(-)


(camel) 02/02: CAMEL-20297 camel-aws2-kinesis: 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 9a4bb60bcc4cdd5125b1516cc3e1596243f91075
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Jan 9 14:32:33 2024 +0100

    CAMEL-20297 camel-aws2-kinesis: do not swallow interrupted exceptions
---
 .../component/aws2/kinesis/Kinesis2Consumer.java   | 27 +++++++++++++++++-----
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Consumer.java b/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Consumer.java
index f913870826e..93209375dcd 100644
--- a/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Consumer.java
+++ b/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Consumer.java
@@ -82,7 +82,10 @@ public class Kinesis2Consumer extends ScheduledBatchPollingConsumer implements R
                             .getAsyncClient(getEndpoint())
                             .describeStream(request)
                             .get();
-                } catch (ExecutionException | InterruptedException e) {
+                } catch (InterruptedException e) {
+                    Thread.currentThread().interrupt();
+                    return 0;
+                } catch (ExecutionException e) {
                     throw new RuntimeException(e);
                 }
             } else {
@@ -123,10 +126,13 @@ public class Kinesis2Consumer extends ScheduledBatchPollingConsumer implements R
             final Shard shard,
             final KinesisConnection kinesisConnection,
             AtomicInteger processedExchangeCount) {
-        String shardIterator;
+        String shardIterator = null;
         try {
             shardIterator = getShardIterator(shard, kinesisConnection);
-        } catch (ExecutionException | InterruptedException e) {
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new RuntimeException(e);
+        } catch (ExecutionException e) {
             throw new RuntimeException(e);
         }
 
@@ -151,7 +157,10 @@ public class Kinesis2Consumer extends ScheduledBatchPollingConsumer implements R
                         .getAsyncClient(getEndpoint())
                         .getRecords(req)
                         .get();
-            } catch (ExecutionException | InterruptedException e) {
+            } catch (InterruptedException e) {
+                Thread.currentThread().interrupt();
+                throw new RuntimeException(e);
+            } catch (ExecutionException e) {
                 throw new RuntimeException(e);
             }
         } else {
@@ -229,7 +238,10 @@ public class Kinesis2Consumer extends ScheduledBatchPollingConsumer implements R
                             .getAsyncClient(getEndpoint())
                             .getShardIterator(request.build())
                             .get();
-                } catch (ExecutionException | InterruptedException e) {
+                } catch (InterruptedException e) {
+                    Thread.currentThread().interrupt();
+                    throw new RuntimeException(e);
+                } catch (ExecutionException e) {
                     throw new RuntimeException(e);
                 }
             } else {
@@ -348,7 +360,10 @@ public class Kinesis2Consumer extends ScheduledBatchPollingConsumer implements R
                         .listShards(request)
                         .get()
                         .shards();
-            } catch (ExecutionException | InterruptedException e) {
+            } catch (InterruptedException e) {
+                Thread.currentThread().interrupt();
+                throw new RuntimeException(e);
+            } catch (ExecutionException e) {
                 throw new RuntimeException(e);
             }
         } else {


(camel) 01/02: CAMEL-20297 camel-aws2-athena: 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 9e173007798562e3d4180a74ab416ad288de83d5
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Jan 9 14:32:24 2024 +0100

    CAMEL-20297 camel-aws2-athena: do not swallow interrupted exceptions
---
 .../java/org/apache/camel/component/aws2/athena/Athena2QueryHelper.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2QueryHelper.java b/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2QueryHelper.java
index 5580e3fde00..97fe349a05d 100644
--- a/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2QueryHelper.java
+++ b/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2QueryHelper.java
@@ -168,6 +168,8 @@ class Athena2QueryHelper {
             this.interrupted = Thread.interrupted(); // store, then clear, interrupt status
             LOG.trace(
                     "AWS Athena start query execution wait thread was interrupted; will return at earliest opportunity");
+
+            Thread.currentThread().interrupt();
         }
         this.currentDelay = this.delay;
     }