Copilot commented on code in PR #23658:
URL: https://github.com/apache/kafka/pull/23658#discussion_r4155505613


##########
streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/TopologyDescriptionPluginIntegrationTest.java:
##########
@@ -158,6 +158,34 @@ public void 
shouldPushTopologyDescriptionOnlyOnceForTwoMembers() throws Exceptio
         }
     }
 
+    @Test
+    public void shouldNotPushTopologyDescriptionWhenDisabledByClient() throws 
Exception {
+        final String appId = "topology-description-push-disabled-app";
+        final String inputTopic = "topology-description-push-disabled-input";
+        cluster.createTopic(inputTopic, 1, 1);
+
+        final Properties config = streamsConfig(appId);
+        config.put(StreamsConfig.TOPOLOGY_DESCRIPTION_PUSH_ENABLED_CONFIG, 
"false");
+
+        try (final Admin admin = createAdmin();
+             final KafkaStreams streams = new 
KafkaStreams(topology(inputTopic), config)) {
+            startApplicationAndWaitUntilRunning(streams);
+
+            // The broker has no stored description for this group and, 
exactly as in
+            // shouldPushTopologyDescriptionToPluginAfterJoin, keeps setting
+            // TopologyDescriptionRequired=true on every heartbeat to solicit 
one; the broker
+            // cannot tell that this client has the push disabled. Waiting 
several heartbeat
+            // intervals gives a suppressed client ample opportunity to push 
anyway if the
+            // client-side opt-out were broken.

Review Comment:
   This explanation is inaccurate: the coordinator arms a 30-second backoff 
when it solicits a topology push, so it does not set 
`TopologyDescriptionRequired` on every 200 ms heartbeat, and this 2-second wait 
cannot observe a second solicitation. The test still exercises the initial 
solicitation; describe that instead of claiming repeated broker requests.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to