gnodet-bot commented on code in PR #30843:
URL: https://github.com/apache/camel/pull/30843#discussion_r4705105830


##########
components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Consumer.java:
##########
@@ -553,8 +554,21 @@ public void run() {
                     trackChildShards(latestShardList);
                     setCurrentShardList(latestShardList);
                 }
-            } catch (Exception e) {
-                LOG.warn("Exception getting latest shard list", e);
+            } catch (VirtualMachineError e) {

Review Comment:
   ⚠️ **Must call `handleFatalError(e)`** — CAMEL-27515 (`#30739`, merged 
yesterday) established that a `VirtualMachineError` in a periodic task of a 
polling consumer must stop the consumer (health DOWN, no more polls). An OOM is 
a JVM problem, not a monitor problem — the consumer should not keep polling.
   
   ```suggestion
             } catch (VirtualMachineError e) {
                 // a JVM-level failure: the consumer stops consuming until the 
route is restarted, and its health
                 // check is DOWN with the error (CAMEL-27515)
                 LOG.error("Fatal error listing the shards of stream {}. The 
consumer stops"
                           + " consuming until the route is restarted.",
                         getEndpoint().getConfiguration().getStreamName(), e);
                 handleFatalError(e);
                 throw e;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to