kkonstantine commented on a change in pull request #8511:
URL: https://github.com/apache/kafka/pull/8511#discussion_r427761810



##########
File path: 
connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java
##########
@@ -280,8 +280,8 @@ public void stop() {
     @Override
     public ClusterConfigState snapshot() {
         synchronized (lock) {
-            // Doing a shallow copy of the data is safe here because the 
complex nested data that is copied should all be
-            // immutable configs
+            // WARNING: Only a shallow copy is performed here; in order to 
avoid accidentally corrupting the worker's view

Review comment:
       I like the improved text. But let's skip `WARNING` since it's not a tag 
we use in comments (such as TODO: for instance) 

##########
File path: 
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/health/ConnectClusterStateImpl.java
##########
@@ -86,7 +86,8 @@ public ConnectorHealth connectorHealth(String connName) {
         FutureCallback<Map<String, String>> connectorConfigCallback = new 
FutureCallback<>();
         herder.connectorConfig(connName, connectorConfigCallback);
         try {
-            return connectorConfigCallback.get(herderRequestTimeoutMs, 
TimeUnit.MILLISECONDS);
+            Map<String, String> result = 
connectorConfigCallback.get(herderRequestTimeoutMs, TimeUnit.MILLISECONDS);
+            return new HashMap<>(result);

Review comment:
       ```suggestion
               return new 
HashMap<>(connectorConfigCallback.get(herderRequestTimeoutMs, 
TimeUnit.MILLISECONDS););
   ```




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to