Skip to content

KafkaMessageListenerContainer.getAssignedPartitions is not safe #3726

Closed
@tbarabanov

Description

@tbarabanov

In what version(s) of Spring for Apache Kafka are you seeing this issue?

3.2.1

Describe the bug

KafkaMessageListenerContainer.getAssignedPartitions() is not safe due to the fact that different threads can iterate/modify any of the fields partitionsListenerConsumer.definedPartitions, partitionsListenerConsumer.assignedPartitions simultaneously, but collection types of these fields are not designed for such scenarios. Thus at least ConcurrentModificationException can be thrown.

Expected behavior

KafkaMessageListenerContainer.getAssignedPartitions() method is public and thus expected to be safe.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions