You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/11/03 15:57:12 UTC

[GitHub] [ozone] elek opened a new pull request #1551: HDDS-4429. Create unit test for SimpleContainerDownloader.

elek opened a new pull request #1551:
URL: https://github.com/apache/ozone/pull/1551


   ## What changes were proposed in this pull request?
   
   @jojochuang  reported that in a specific case the Datanode tried to download / replicate containers multiple times from the same datanode.
   
   SimpleContainerDownload has a logic to try out all the available Datanodes: this Jira creates a unit test t make sure the logic works well.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-4429
   
   ## How was this patch tested?
   
   Executed the new unit test.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on pull request #1551: HDDS-4429. Create unit test for SimpleContainerDownloader.

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on pull request #1551:
URL: https://github.com/apache/ozone/pull/1551#issuecomment-733148656


   Thanks @elek for updating the patch.
   
   Can you please also increase the timeout for `testRandomSelection`?  It failed recently (in PRs) quite a few times with:
   
   ```
   [INFO] Running org.apache.hadoop.ozone.container.replication.TestSimpleContainerDownloader
   Error:  Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.187 s <<< FAILURE! - in org.apache.hadoop.ozone.container.replication.TestSimpleContainerDownloader
   Error:  testRandomSelection(org.apache.hadoop.ozone.container.replication.TestSimpleContainerDownloader)  Time elapsed: 1.012 s  <<< ERROR!
   java.lang.Exception: test timed out after 1000 milliseconds
   	at java.lang.ClassLoader.defineClass1(Native Method)
   	at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
   	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
   	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
   	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
   	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
   	at java.security.AccessController.doPrivileged(Native Method)
   	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
   	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
   	at org.bouncycastle.jcajce.provider.symmetric.Serpent$Mappings.configure(Unknown Source)
   	at org.bouncycastle.jce.provider.BouncyCastleProvider.loadAlgorithms(Unknown Source)
   	at org.bouncycastle.jce.provider.BouncyCastleProvider.setup(Unknown Source)
   	at org.bouncycastle.jce.provider.BouncyCastleProvider.access$000(Unknown Source)
   	at org.bouncycastle.jce.provider.BouncyCastleProvider$1.run(Unknown Source)
   	at java.security.AccessController.doPrivileged(Native Method)
   	at org.bouncycastle.jce.provider.BouncyCastleProvider.<init>(Unknown Source)
   	at org.apache.hadoop.hdds.security.x509.SecurityConfig.initSecurityProvider(SecurityConfig.java:369)
   	at org.apache.hadoop.hdds.security.x509.SecurityConfig.<init>(SecurityConfig.java:172)
   	at org.apache.hadoop.ozone.container.replication.SimpleContainerDownloader.<init>(SimpleContainerDownloader.java:69)
   	at org.apache.hadoop.ozone.container.replication.TestSimpleContainerDownloader$1.<init>(TestSimpleContainerDownloader.java:53)
   	at org.apache.hadoop.ozone.container.replication.TestSimpleContainerDownloader.testRandomSelection(TestSimpleContainerDownloader.java:52)
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on a change in pull request #1551: HDDS-4429. Create unit test for SimpleContainerDownloader.

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #1551:
URL: https://github.com/apache/ozone/pull/1551#discussion_r521327400



##########
File path: hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestSimpleContainerDownloader.java
##########
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.container.replication;
+
+import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.hadoop.hdds.conf.ConfigurationSource;
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.hdds.protocol.DatanodeDetails;
+import org.apache.hadoop.hdds.protocol.MockDatanodeDetails;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Test SimpleContainerDownloader.
+ */
+public class TestSimpleContainerDownloader {
+
+  @Test
+  public void testGetContainerDataFromReplicasHappyPath() throws Exception {
+
+    //GIVEN
+    List<DatanodeDetails> datanodes = createDatanodes();
+
+    SimpleContainerDownloader downloader =
+        createDownloaderWithPredefinedFailures();
+
+    //WHEN
+    final Path result =
+        downloader.getContainerDataFromReplicas(1L, datanodes)
+            .get(1L, TimeUnit.SECONDS);
+
+    //THEN
+    Assert.assertEquals(datanodes.get(0).getUuidString(), result.toString());
+  }
+
+  @Test
+  public void testGetContainerDataFromReplicasOneFailure() throws Exception {
+
+    //GIVEN
+    List<DatanodeDetails> datanodes = createDatanodes();
+
+    SimpleContainerDownloader downloader =
+        createDownloaderWithPredefinedFailures(datanodes.get(0));
+
+    //WHEN
+    final Path result =
+        downloader.getContainerDataFromReplicas(1L, datanodes)
+            .get(1L, TimeUnit.SECONDS);
+
+    //THEN
+    //first datanode is failed, second worked
+    Assert.assertEquals(datanodes.get(1).getUuidString(), result.toString());
+  }
+
+  /**
+   * Creates downloader which fails with datanodes in the arguments.
+   */
+  private SimpleContainerDownloader createDownloaderWithPredefinedFailures(
+      DatanodeDetails... failedDatanodes
+  ) {
+
+    ConfigurationSource conf = new OzoneConfiguration();
+
+    final List<DatanodeDetails> datanodes =
+        Arrays.asList(failedDatanodes);
+
+    return new SimpleContainerDownloader(conf, null) {
+
+      @Override
+      protected CompletableFuture<Path> downloadContainer(
+          long containerId,
+          DatanodeDetails datanode
+      ) throws IOException {
+
+        if (datanodes.contains(datanode)) {
+          throw new IOException("Unavailable datanode");

Review comment:
       `downloadContainer` may fail in two ways: `IOException` may be thrown immediately or the returned `CompletableFuture` may be completed exceptionally.  These hit different code paths in `getContainerDataFromReplicas`.  I think we should cover both cases.

##########
File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/SimpleContainerDownloader.java
##########
@@ -74,21 +75,13 @@ public SimpleContainerDownloader(ConfigurationSource conf,
     for (DatanodeDetails datanode : sourceDatanodes) {
       try {
         if (result == null) {
-          GrpcReplicationClient grpcReplicationClient =
-              new GrpcReplicationClient(datanode.getIpAddress(),
-                  datanode.getPort(Name.STANDALONE).getValue(),
-                  workingDirectory, securityConfig, caCert);
-          result = grpcReplicationClient.download(containerId);
+          result = downloadContainer(containerId, datanode);
         } else {
           result = result.thenApply(CompletableFuture::completedFuture)
               .exceptionally(t -> {
                 LOG.error("Error on replicating container: " + containerId, t);
                 try {
-                  GrpcReplicationClient grpcReplicationClient =
-                      new GrpcReplicationClient(datanode.getIpAddress(),
-                          datanode.getPort(Name.STANDALONE).getValue(),
-                          workingDirectory, securityConfig, caCert);
-                  return grpcReplicationClient.download(containerId);
+                  return downloadContainer(containerId, datanode);
                 } catch (IOException e) {
                   LOG.error("Error on replicating container: " + containerId,
                       t);

Review comment:
       Not introduced in this patch, but I think this should be:
   
   ```suggestion
                   } catch (IOException e) {
                     LOG.error("Error on replicating container: " + containerId,
                         e);
   ```




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on a change in pull request #1551: HDDS-4429. Create unit test for SimpleContainerDownloader.

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #1551:
URL: https://github.com/apache/ozone/pull/1551#discussion_r526342097



##########
File path: hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestSimpleContainerDownloader.java
##########
@@ -21,24 +21,84 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
 
+import org.apache.hadoop.hdds.conf.ConfigurationSource;
 import org.apache.hadoop.hdds.conf.OzoneConfiguration;
 import org.apache.hadoop.hdds.protocol.DatanodeDetails;
 import org.apache.hadoop.hdds.protocol.MockDatanodeDetails;
 
 import org.junit.Assert;
 import org.junit.Test;
 
-/**
- * Test container downloader.
+/*
+ * Test SimpleContainerDownloader.
  */
 public class TestSimpleContainerDownloader {
 
   private static final String SUCCESS_PATH = "downloaded";
 
+  @Test
+  public void testGetContainerDataFromReplicasHappyPath() throws Exception {
+
+    //GIVEN
+    List<DatanodeDetails> datanodes = createDatanodes();
+
+    SimpleContainerDownloader downloader =
+        createDownloaderWithPredefinedFailures(true);
+
+    //WHEN
+    final Path result =
+        downloader.getContainerDataFromReplicas(1L, datanodes)
+            .get(1L, TimeUnit.SECONDS);
+
+    //THEN
+    Assert.assertEquals(datanodes.get(0).getUuidString(), result.toString());

Review comment:
       Actually, these checks are no longer valid after 5e8aaee77 since `SimpleContainerDownloader` shuffles the datanodes.
   
   https://github.com/apache/ozone/blob/0aca5c7058252a60db91ac06a5ded931e1e08296/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/SimpleContainerDownloader.java#L79-L84




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on pull request #1551: HDDS-4429. Create unit test for SimpleContainerDownloader.

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on pull request #1551:
URL: https://github.com/apache/ozone/pull/1551#issuecomment-735986723


   Thanks @elek for the improvement.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] elek commented on a change in pull request #1551: HDDS-4429. Create unit test for SimpleContainerDownloader.

Posted by GitBox <gi...@apache.org>.
elek commented on a change in pull request #1551:
URL: https://github.com/apache/ozone/pull/1551#discussion_r521946625



##########
File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/SimpleContainerDownloader.java
##########
@@ -74,21 +75,13 @@ public SimpleContainerDownloader(ConfigurationSource conf,
     for (DatanodeDetails datanode : sourceDatanodes) {
       try {
         if (result == null) {
-          GrpcReplicationClient grpcReplicationClient =
-              new GrpcReplicationClient(datanode.getIpAddress(),
-                  datanode.getPort(Name.STANDALONE).getValue(),
-                  workingDirectory, securityConfig, caCert);
-          result = grpcReplicationClient.download(containerId);
+          result = downloadContainer(containerId, datanode);
         } else {
           result = result.thenApply(CompletableFuture::completedFuture)
               .exceptionally(t -> {
                 LOG.error("Error on replicating container: " + containerId, t);
                 try {
-                  GrpcReplicationClient grpcReplicationClient =
-                      new GrpcReplicationClient(datanode.getIpAddress(),
-                          datanode.getPort(Name.STANDALONE).getValue(),
-                          workingDirectory, securityConfig, caCert);
-                  return grpcReplicationClient.download(containerId);
+                  return downloadContainer(containerId, datanode);
                 } catch (IOException e) {
                   LOG.error("Error on replicating container: " + containerId,
                       t);

Review comment:
       Nice catch, thx.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] elek commented on a change in pull request #1551: HDDS-4429. Create unit test for SimpleContainerDownloader.

Posted by GitBox <gi...@apache.org>.
elek commented on a change in pull request #1551:
URL: https://github.com/apache/ozone/pull/1551#discussion_r528658762



##########
File path: hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestSimpleContainerDownloader.java
##########
@@ -21,24 +21,84 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
 
+import org.apache.hadoop.hdds.conf.ConfigurationSource;
 import org.apache.hadoop.hdds.conf.OzoneConfiguration;
 import org.apache.hadoop.hdds.protocol.DatanodeDetails;
 import org.apache.hadoop.hdds.protocol.MockDatanodeDetails;
 
 import org.junit.Assert;
 import org.junit.Test;
 
-/**
- * Test container downloader.
+/*
+ * Test SimpleContainerDownloader.
  */
 public class TestSimpleContainerDownloader {
 
   private static final String SUCCESS_PATH = "downloaded";
 
+  @Test
+  public void testGetContainerDataFromReplicasHappyPath() throws Exception {
+
+    //GIVEN
+    List<DatanodeDetails> datanodes = createDatanodes();
+
+    SimpleContainerDownloader downloader =
+        createDownloaderWithPredefinedFailures(true);
+
+    //WHEN
+    final Path result =
+        downloader.getContainerDataFromReplicas(1L, datanodes)
+            .get(1L, TimeUnit.SECONDS);
+
+    //THEN
+    Assert.assertEquals(datanodes.get(0).getUuidString(), result.toString());

Review comment:
       Looking into it. Seems I stepped in my own trap ;-)




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] elek commented on a change in pull request #1551: HDDS-4429. Create unit test for SimpleContainerDownloader.

Posted by GitBox <gi...@apache.org>.
elek commented on a change in pull request #1551:
URL: https://github.com/apache/ozone/pull/1551#discussion_r521955491



##########
File path: hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestSimpleContainerDownloader.java
##########
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.container.replication;
+
+import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.hadoop.hdds.conf.ConfigurationSource;
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.hdds.protocol.DatanodeDetails;
+import org.apache.hadoop.hdds.protocol.MockDatanodeDetails;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Test SimpleContainerDownloader.
+ */
+public class TestSimpleContainerDownloader {
+
+  @Test
+  public void testGetContainerDataFromReplicasHappyPath() throws Exception {
+
+    //GIVEN
+    List<DatanodeDetails> datanodes = createDatanodes();
+
+    SimpleContainerDownloader downloader =
+        createDownloaderWithPredefinedFailures();
+
+    //WHEN
+    final Path result =
+        downloader.getContainerDataFromReplicas(1L, datanodes)
+            .get(1L, TimeUnit.SECONDS);
+
+    //THEN
+    Assert.assertEquals(datanodes.get(0).getUuidString(), result.toString());
+  }
+
+  @Test
+  public void testGetContainerDataFromReplicasOneFailure() throws Exception {
+
+    //GIVEN
+    List<DatanodeDetails> datanodes = createDatanodes();
+
+    SimpleContainerDownloader downloader =
+        createDownloaderWithPredefinedFailures(datanodes.get(0));
+
+    //WHEN
+    final Path result =
+        downloader.getContainerDataFromReplicas(1L, datanodes)
+            .get(1L, TimeUnit.SECONDS);
+
+    //THEN
+    //first datanode is failed, second worked
+    Assert.assertEquals(datanodes.get(1).getUuidString(), result.toString());
+  }
+
+  /**
+   * Creates downloader which fails with datanodes in the arguments.
+   */
+  private SimpleContainerDownloader createDownloaderWithPredefinedFailures(
+      DatanodeDetails... failedDatanodes
+  ) {
+
+    ConfigurationSource conf = new OzoneConfiguration();
+
+    final List<DatanodeDetails> datanodes =
+        Arrays.asList(failedDatanodes);
+
+    return new SimpleContainerDownloader(conf, null) {
+
+      @Override
+      protected CompletableFuture<Path> downloadContainer(
+          long containerId,
+          DatanodeDetails datanode
+      ) throws IOException {
+
+        if (datanodes.contains(datanode)) {
+          throw new IOException("Unavailable datanode");

Review comment:
       Good point. Added a new test case.
   
   (As the test method is already simplified with helper methods, seems to be more simple to create a new method instead of introducing a new parametrized Junit test)




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai merged pull request #1551: HDDS-4429. Create unit test for SimpleContainerDownloader.

Posted by GitBox <gi...@apache.org>.
adoroszlai merged pull request #1551:
URL: https://github.com/apache/ozone/pull/1551


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on a change in pull request #1551: HDDS-4429. Create unit test for SimpleContainerDownloader.

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #1551:
URL: https://github.com/apache/ozone/pull/1551#discussion_r532705494



##########
File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/SimpleContainerDownloader.java
##########
@@ -128,12 +130,20 @@ public SimpleContainerDownloader(ConfigurationSource conf,
       DatanodeDetails datanode
   ) throws Exception {
     CompletableFuture<Path> result;
-    try (GrpcReplicationClient grpcReplicationClient =
+    GrpcReplicationClient grpcReplicationClient =
         new GrpcReplicationClient(datanode.getIpAddress(),
             datanode.getPort(Name.STANDALONE).getValue(),
-            workingDirectory, securityConfig, caCert)) {
-      result = grpcReplicationClient.download(containerId);
-    }
+            workingDirectory, securityConfig, caCert);
+    result = grpcReplicationClient.download(containerId)
+        .thenApply(r -> {
+          try {
+            grpcReplicationClient.close();

Review comment:
       So if replication was slow, the previous version may have closed the client prematurely?




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org