jojochuang commented on code in PR #8987:
URL: https://github.com/apache/ozone/pull/8987#discussion_r2312839553


##########
hadoop-ozone/csi/pom.xml:
##########
@@ -81,6 +81,10 @@
       <groupId>io.grpc</groupId>
       <artifactId>grpc-stub</artifactId>
     </dependency>
+    <dependency>
+      <groupId>io.netty</groupId>

Review Comment:
   wonder why this is required only now.



##########
hadoop-ozone/csi/src/main/java/org/apache/hadoop/ozone/csi/CsiServer.java:
##########
@@ -57,33 +57,93 @@ public Void call() throws Exception {
             CsiServer.class, originalArgs, LOG, ozoneConfiguration);
     CsiConfig csiConfig = ozoneConfiguration.getObject(CsiConfig.class);
 
-    OzoneClient rpcClient = 
OzoneClientFactory.getRpcClient(ozoneConfiguration);
+    validateConfiguration(csiConfig);
 
-    EpollEventLoopGroup group = new EpollEventLoopGroup();
+    OzoneClient rpcClient = null;
+    EpollEventLoopGroup group = null;
+    Server server = null;
 
+    try {
+      rpcClient = OzoneClientFactory.getRpcClient(ozoneConfiguration);
+      group = new EpollEventLoopGroup();
+
+      server = buildGrpcServer(csiConfig, rpcClient, group);
+
+      server.start();
+      LOG.info("CSI server started successfully on socket: {}",
+          csiConfig.getSocketPath());
+
+      addShutdownHook(server, rpcClient, group);
+
+      server.awaitTermination();
+    } catch (Exception e) {
+      LOG.error("Error starting CSI server", e);
+      cleanup(server, rpcClient, group);

Review Comment:
   i think we want to close rpcClient regardless of exception or not.
   (can w put cleanup() in the finally {} block?)



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