Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-3726: Fix KafkaMessageListenerContainer for ConcurrentModification…
…Exception Fixes: #3726 Issue link: #3726 `KafkaMessageListenerContainer.getAssignedPartitions()` is not safe due to the fact that different threads can iterate/modify any of the fields `partitionsListenerConsumer.definedPartitions` or `partitionsListenerConsumer.assignedPartitions` simultaneously, but collection types of these fields are not designed for such scenarios. Thus at least `ConcurrentModificationException` can be thrown. * Wrap `partitionsListenerConsumer.definedPartitions` and `partitionsListenerConsumer.assignedPartitions` into `Collections.synchronizedSet()` Signed-off-by: Tim Barabanov <[email protected]> [[email protected] Fix commit message] **Auto-cherry-pick to `3.2.x`** Signed-off-by: Artem Bilan <[email protected]>
- Loading branch information