Xiaobing Fang created KAFKA-15771: ------------------------------------- Summary: ProduceRequest#partitionSizes() is not an atomic operation Key: KAFKA-15771 URL: https://issues.apache.org/jira/browse/KAFKA-15771 Project: Kafka Issue Type: Bug Components: producer Reporter: Xiaobing Fang
Encountered a concurrency issue in method ProduceRequest#partitionSizes() while developing with Kafka. When both Thread 1 and Thread 2 concurrently call method ProduceRequest#partitionSizes(), Thread 2 may receive an incomplete or empty result if Thread 1 is still in the process of initializing partitionSizes. This is an incorrect state. the code to ensure that Thread 2 obtains the final state rather than an intermediate one. -- This message was sent by Atlassian Jira (v8.20.10#820010)