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

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

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


##########
storage/src/test/java/org/apache/kafka/server/log/remote/metadata/storage/TopicBasedRemoteLogMetadataManagerHarness.java:
##########
@@ -104,27 +103,10 @@ public void onPartitionLeadershipChanges(Set<TopicIdPartition> leaderPartitions,
         log.debug("TopicBasedRemoteLogMetadataManager configs after adding overridden properties: {}", configs);
 
         topicBasedRemoteLogMetadataManager.configure(configs);
-        try {
-            waitUntilInitialized(60_000);
-        } catch (TimeoutException e) {
-            throw new KafkaException(e);
-        }
-
         topicBasedRemoteLogMetadataManager.onPartitionLeadershipChanges(topicIdPartitions, Collections.emptySet());
     }
 
     // Visible for testing.
-    public void waitUntilInitialized(long waitTimeMs) throws TimeoutException {

Review Comment:
   This was removed because the entire point of this PR is to make explicit waiting redundant. The fact that this was only possible in a test because of package private is the underlying reason behind this change, in other words when running `TopicBasedRemoteLogMetadataManager` normally within a broker it was too easy to call methods before the`TopicBasedRemoteLogMetadataManager` was finished initializing.



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