This is an automated email from the ASF dual-hosted git repository.

martijnvisser pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 6278f7ac267060d8d1921d44a6ed1eb5d498acde
Author: Martijn Visser <[email protected]>
AuthorDate: Tue Mar 3 15:05:45 2026 +0100

    [hotfix][runtime] Guard DEBUG log calls with isDebugEnabled in 
ZooKeeperLeaderRetrievalDriver
---
 .../ZooKeeperLeaderRetrievalDriver.java                | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git 
a/flink-runtime/src/main/java/org/apache/flink/runtime/leaderretrieval/ZooKeeperLeaderRetrievalDriver.java
 
b/flink-runtime/src/main/java/org/apache/flink/runtime/leaderretrieval/ZooKeeperLeaderRetrievalDriver.java
index a97198617a1..ba870a1f06e 100644
--- 
a/flink-runtime/src/main/java/org/apache/flink/runtime/leaderretrieval/ZooKeeperLeaderRetrievalDriver.java
+++ 
b/flink-runtime/src/main/java/org/apache/flink/runtime/leaderretrieval/ZooKeeperLeaderRetrievalDriver.java
@@ -104,10 +104,12 @@ public class ZooKeeperLeaderRetrievalDriver implements 
LeaderRetrievalDriver {
 
         
client.getConnectionStateListenable().addListener(connectionStateListener);
 
-        LOG.debug(
-                "Monitoring data change in {}",
-                ZooKeeperUtils.generateZookeeperPath(
-                        client.getNamespace(), connectionInformationPath));
+        if (LOG.isDebugEnabled()) {
+            LOG.debug(
+                    "Monitoring data change in {}",
+                    ZooKeeperUtils.generateZookeeperPath(
+                            client.getNamespace(), connectionInformationPath));
+        }
 
         running = true;
     }
@@ -142,7 +144,9 @@ public class ZooKeeperLeaderRetrievalDriver implements 
LeaderRetrievalDriver {
 
     private void retrieveLeaderInformationFromZooKeeper() {
         try {
-            LOG.debug("Leader node has changed.");
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Leader node has changed.");
+            }
 
             final ChildData childData = 
cache.getCurrentData(connectionInformationPath);
 
@@ -170,7 +174,9 @@ public class ZooKeeperLeaderRetrievalDriver implements 
LeaderRetrievalDriver {
     private void handleStateChange(ConnectionState newState) {
         switch (newState) {
             case CONNECTED:
-                LOG.debug("Connected to ZooKeeper quorum. Leader retrieval can 
start.");
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Connected to ZooKeeper quorum. Leader retrieval 
can start.");
+                }
                 break;
             case SUSPENDED:
                 LOG.warn("Connection to ZooKeeper suspended, waiting for 
reconnection.");

Reply via email to