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

   ## Summary
   
   _Claude Code on behalf of davsclaus_
   
   Fixes four correctness bugs in `KafkaIdempotentRepository`:
   
   - **Non-atomic `add()`**: replaced `containsKey()` + `put()` with 
`putIfAbsent()` to prevent concurrent duplicate insertions
   - **Stale cache on broadcast failure**: `add()` now rolls back the local 
cache entry if the Kafka broadcast fails, so retries are not blocked
   - **Unsafe shutdown ordering**: `doStop()` now stops the poller and wakes 
the consumer before shutting down the executor, preventing 
`ConcurrentModificationException` from closing the consumer while the poller 
thread is still polling
   - **`clear()` not clearing local cache**: `clear()` now calls 
`cache.clear()` before broadcasting, fixing the case where `startupOnly=true` 
(no poller to process the broadcast back)
   
   Also adds `KafkaIdempotentRepositoryTest` with unit tests for cache 
operations using `MockProducer`.
   
   ## Test plan
   
   - [x] New `KafkaIdempotentRepositoryTest` (9 tests) — all pass
   - [x] All 155 existing `camel-kafka` tests pass with no regressions
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


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