duongkame commented on code in PR #4373:
URL: https://github.com/apache/ozone/pull/4373#discussion_r1137656109


##########
hadoop-ozone/fault-injection-test/mini-chaos-tests/src/test/java/org/apache/hadoop/ozone/TestMiniChaosOzoneCluster.java:
##########
@@ -136,7 +136,7 @@ public static void init() throws Exception {
     cluster.waitForClusterToBeReady();
 
     String volumeName = RandomStringUtils.randomAlphabetic(10).toLowerCase();
-    ObjectStore store = cluster.getRpcClient().getObjectStore();
+    ObjectStore store = cluster.newClient().getObjectStore();

Review Comment:
   Do we want to close this created client?



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystemMetrics.java:
##########
@@ -81,9 +84,10 @@ public static void init() throws Exception {
         .setStreamBufferMaxSize(4) // MB
         .build();
     cluster.waitForClusterToBeReady();
+    client = cluster.getClient();
 
     // create a volume and a bucket to be used by OzoneFileSystem
-    bucket = TestDataUtil.createVolumeAndBucket(cluster);
+    bucket = TestDataUtil.createVolumeAndBucket(client);

Review Comment:
   Previously, `cluster` was passed and the problem is `createVolumeAndBucket` 
didn't close the client it acquires internally. Just fixing that would result 
in less code change than allowing `client` to be passed (and many test classes 
have to introduce the client variable and ensure closing it in this PR). 
   The test class can create a new `client` if for their needs and ensure 
closing themself.
   
   But, I'm ok either way.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to