shashank created CAMEL-27459:
--------------------------------

             Summary: camel-aws2-kinesis - an Error in one run of the shard 
monitor stops it for good, without a log line: shards created by a later split 
or merge are never read
                 Key: CAMEL-27459
                 URL: https://issues.apache.org/jira/browse/CAMEL-27459
             Project: Camel
          Issue Type: Bug
          Components: camel-aws2-kinesis
            Reporter: shashank
            Assignee: shashank


h3. What happens

The polling consumer (without {{useKclConsumers}}) lists the shards of the 
stream with a task scheduled with {{scheduleAtFixedRate}} every 
{{shardMonitorInterval}}. {{ShardMonitor.run}} catches only {{Exception}}. An 
{{Error}} of one run ({{NoClassDefFoundError}}, 
{{ExceptionInInitializerError}}, {{AssertionError}}, or an {{OutOfMemoryError}} 
while a response is read) ends the scheduled task: the executor keeps the error 
in the {{ScheduledFuture}}, which nothing reads, so nothing is logged, and the 
task never runs again. The consumer goes on reading the shards of the last 
list. After the next split or merge the new shards are never listed, so their 
records are never read, and the consumer stays UP until the route is restarted.

{{ScheduledPollConsumer.run}} logs such an error for the same reason, and 
CAMEL-26906 fixed the same case in {{TimerListenerManager}}.

h3. How to reproduce

A consumer with a mocked {{KinesisClient}} whose second {{listShards}} throws 
{{NoClassDefFoundError}} and whose later calls return the shards of a split: 
the list of the consumer never gets the child shards, and nothing is logged.

h3. Fix

As in CAMEL-26906: an {{Error}} of a run is logged at WARN and the task runs 
again at the next interval. A {{VirtualMachineError}} (such as an 
{{OutOfMemoryError}}) is thrown on as before, which ends the task, and is now 
logged at ERROR first; the consumer goes on reading the shards it knows, as 
before, until it is restarted (a start schedules a new shard monitor).

Minor: an {{Error}} in this code path is uncommon, and a restart recovers (the 
records are still in the stream within its retention). When it happens, though, 
the shards of every later reshard are not read and nothing shows it.

Not changed here: a {{ListShards}} call of the async client waits without a 
timeout; and the consumer reported ready while {{ListShards}} fails from the 
start, which is reported separately.

_Filed with Claude Code on behalf of allthingssecurity._



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to