You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "reta (via GitHub)" <gi...@apache.org> on 2023/05/08 15:40:31 UTC

[GitHub] [kafka] reta commented on a diff in pull request #13689: KAFKA-14975: Wait for TopicBasedRemoteLogMetadataManager.ensureInitializedAndNotClosed to initialize rather than throwing

reta commented on code in PR #13689:
URL: https://github.com/apache/kafka/pull/13689#discussion_r1187596223


##########
storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/TopicBasedRemoteLogMetadataManager.java:
##########
@@ -76,6 +78,11 @@ public class TopicBasedRemoteLogMetadataManager implements RemoteLogMetadataMana
     private final boolean startConsumerThread;
 
     private Thread initializationThread;
+
+    private static final long SHUTDOWN_TIMEOUT_SECONDS = 60L;
+
+    private CountDownLatch initializeLatch;

Review Comment:
   Just a suggestion, but I think you could simplify tracking the initialization flow by folding  `initializeLatch` & `initialized` into a `CompletableFuture` (which could also handle the case when close is called while the initialization is still in progress).



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