Copilot commented on code in PR #11246:
URL: https://github.com/apache/ozone/pull/11246#discussion_r4020763596


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/endpoint/VersionEndpointTask.java:
##########
@@ -72,20 +71,27 @@ public EndpointStateMachine.EndPointStates call() throws 
Exception {
 
         if (!rpcEndPoint.isPassive()) {
           // If end point is passive, datanode does not need to check volumes.
-          String scmId = response.getValue(OzoneConsts.SCM_ID);
-          String clusterId = response.getValue(OzoneConsts.CLUSTER_ID);
+          try {
+            String scmId = response.getValue(OzoneConsts.SCM_ID);
+            String clusterId = response.getValue(OzoneConsts.CLUSTER_ID);
 
-          Objects.requireNonNull(scmId, "scmId == null");
-          Objects.requireNonNull(clusterId, "clusterId == null");
+            Objects.requireNonNull(scmId, "scmId == null");
+            Objects.requireNonNull(clusterId, "clusterId == null");
 
-          // Check DbVolumes, format DbVolume at first register time.
-          checkVolumeSet(ozoneContainer.getDbVolumeSet(), scmId, clusterId);
+            // Check DbVolumes, format DbVolume at first register time.
+            checkVolumeSet(ozoneContainer.getDbVolumeSet(), scmId, clusterId);
 
-          // Check HddsVolumes
-          checkVolumeSet(ozoneContainer.getVolumeSet(), scmId, clusterId);
+            // Check HddsVolumes
+            checkVolumeSet(ozoneContainer.getVolumeSet(), scmId, clusterId);
 
-          // Start the container services after getting the version information
-          ozoneContainer.start(clusterId);
+            // Start the container services after getting the version 
information
+            ozoneContainer.start(clusterId);
+          } catch (Exception ex) {

Review Comment:
   `OzoneContainer.start()` explicitly records and rethrows `Error` as 
`FAILED`, but this catch only handles `Exception`. If local initialization 
raises an `Error`, the endpoint remains in `GETVERSION` and 
`RunningDatanodeState` treats the exceptional future as `RUNNING`, so the 
datanode can continue serving until a later retry instead of taking the fatal 
shutdown path immediately. Include `Error` in this fatal branch to match the 
failure classification in `OzoneContainer`.



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