smjn commented on code in PR #22601:
URL: https://github.com/apache/kafka/pull/22601#discussion_r3492900944


##########
server/src/main/java/org/apache/kafka/server/share/dlq/ShareGroupDLQStateManager.java:
##########
@@ -238,9 +250,18 @@ class ProduceRequestHandler implements 
RequestCompletionHandler {
         private static final Logger LOG = 
LoggerFactory.getLogger(ShareGroupDLQStateManager.ProduceRequestHandler.class);
         private final ExponentialBackoffManager createTopicsBackoff;
         private final ExponentialBackoffManager produceRequestBackoff;
-        private Node dlqPartitionLeaderNode;
-        private int dlqDestinationPartition;
-        private ShareGroupDLQMetadataCacheHelper.TopicPartitionData 
dlqTopicPartitionData;
+        // These DLQ topic fields are written by populateDLQTopicData() and 
read while building the
+        // produce request - both on the sender thread (from 
dlqTopicExists()/handleCreateTopicsResponse()).
+        // Kept volatile defensively.

Review Comment:
   Since the sender in the share group state manager runs as a separate thread 
which is separate from the state manager, the volatile qualifier is justified.



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