satishd commented on a change in pull request #11058:
URL: https://github.com/apache/kafka/pull/11058#discussion_r719512519



##########
File path: 
storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/ConsumerTask.java
##########
@@ -240,6 +323,11 @@ public void close() {
                 // if the closing is already set.
                 closing = true;
                 consumer.wakeup();
+                try {
+                    maybeSyncCommittedDataAndOffsets(true);

Review comment:
       Another way is to call `maybeSyncCommittedDataAndOffsets` in finally 
block of run method before `closeConsumer()`. This will avoid running in 
multiple threads and the state that is read is consistent. 




-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to