C0urante commented on a change in pull request #8910:
URL: https://github.com/apache/kafka/pull/8910#discussion_r446490310



##########
File path: 
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSinkTask.java
##########
@@ -689,6 +692,10 @@ else if (!context.pausedPartitions().isEmpty())
 
         @Override
         public void onPartitionsRevoked(Collection<TopicPartition> partitions) 
{
+            if (taskStopped) {

Review comment:
       The callback gets invoked on the same thread as the one that 
`KafkaConsumer::close` is invoked on, so `volatile` isn't strictly necessary. 
If you (or others) think it'd be good to include just in case that changes or 
this callback gets invoked after the task is stopped on a different thread 
(which afaik is not possible atm), I don't have any major objections to adding 
it. Just didn't want to add it unnecessarily as it might be misleading to 
people reading the code base down the road. LMKWYT




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

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


Reply via email to