oscerd opened a new pull request, #24744:
URL: https://github.com/apache/camel/pull/24744

   Backport of #24717 to `camel-4.18.x`.
   
   Fixes [CAMEL-24080](https://issues.apache.org/jira/browse/CAMEL-24080) on 
the 4.18.x line.
   
   The Kinesis consumer's shard state (`currentShardIterators`, `warnLogged`) 
is written concurrently from `poll()`'s `parallelStream()` over the shard list; 
it was a plain `HashMap`/`HashSet`, and the poll count used `getAndSet` (plus a 
`set(0)` reset) so parallel shards overwrote each other. This uses 
`ConcurrentHashMap` / `ConcurrentHashMap.newKeySet()` and accumulates with 
`addAndGet()`. A sentinel (empty string) replaces the previous `null` 
closed-shard marker, since `ConcurrentHashMap` forbids null values.
   
   Cherry-pick of the merged main commit; the only adaptations were the 
maintenance-branch import style (FQCN `java.util.HashMap`) and the closed-shard 
guard already using `== null`. `KinesisConsumerMultiShardTest` and the existing 
closed-shard tests pass on this branch.
   
   Per project policy no upgrade-guide entry is added on the maintenance branch.
   
   ---
   _Claude Code on behalf of oscerd_


-- 
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