You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/07/06 14:54:09 UTC
[GitHub] [kafka] ccding commented on a change in pull request #10579: KAFKA-9555 Added default RLMM implementation based on internal topic storage.
ccding commented on a change in pull request #10579:
URL: https://github.com/apache/kafka/pull/10579#discussion_r664630725
##########
File path: storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/ConsumerTask.java
##########
@@ -220,16 +227,16 @@ public boolean isPartitionAssigned(int partition) {
return assignedMetaPartitions.contains(partition);
}
- private void ensureNotClosed() {
- if (closing) {
- throw new IllegalStateException("This instance is already closed");
- }
- }
-
public void close() {
if (!closing) {
- closing = true;
- consumer.wakeup();
+ synchronized (assignPartitionsLock) {
+ // Closing should be updated only after acquiring the lock to avoid race in
+ // maybeWaitForPartitionsAssignment() where it waits on assignPartitionsLock. It should not wait
+ // if the closing is already set.
+ closing = true;
Review comment:
Is it possible two threads call `close()` concurrently?
--
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org