sumitagrawl commented on code in PR #12145:
URL: https://github.com/apache/ozone/pull/12145#discussion_r4704758338


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/protocol/SecretKeyProtocolServerSideTranslatorPB.java:
##########
@@ -117,8 +119,11 @@ public SCMSecretKeyResponse 
processRequest(SCMSecretKeyRequest request)
     } catch (IOException e) {
       RatisUtil.checkRatisException(e, scm.getSecurityProtocolRpcPort(),
           scm.getScmId(), scm.getHostname(), ROLE_TYPE);
+      TracingUtil.recordExceptionInCurrentSpan(e);
       scmSecurityResponse.setSuccess(false);
       scmSecurityResponse.setStatus(exceptionToResponseStatus(e));
+      
TracingUtil.addAttributesToCurrentSpan(OzoneTracingAttributes.ERROR_STATUS,

Review Comment:
   recordException**() already does setStatus, setting attribute is not useful



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMStateMachine.java:
##########
@@ -231,9 +239,12 @@ public CompletableFuture<Message> applyTransaction(
       // in both places. No-op once the datanode protocol server has started.
       tryStartDNServerAndRefreshSafeMode();
     } catch (Exception ex) {
+      TracingUtil.recordException(span, ex);
+      span.end();

Review Comment:
   finally already doing span.end(), this is redundant



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/protocol/SCMSecurityProtocolServerSideTranslatorPB.java:
##########
@@ -150,8 +152,11 @@ public SCMSecurityResponse 
processRequest(SCMSecurityRequest request)
     } catch (IOException e) {
       RatisUtil.checkRatisException(e, scm.getSecurityProtocolRpcPort(),
           scm.getScmId(), scm.getHostname(), ROLE_TYPE);
+      TracingUtil.recordExceptionInCurrentSpan(e);
       scmSecurityResponse.setSuccess(false);
       scmSecurityResponse.setStatus(exceptionToResponseStatus(e));
+      
TracingUtil.addAttributesToCurrentSpan(OzoneTracingAttributes.ERROR_STATUS,

Review Comment:
   recordException**() already does setStatus, setting attribute is not useful



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/protocol/ScmBlockLocationProtocolServerSideTranslatorPB.java:
##########
@@ -192,8 +194,10 @@ private SCMBlockLocationResponse processMessage(
     } catch (IOException e) {
       RatisUtil.checkRatisException(e, scm.getBlockProtocolRpcPort(),
           scm.getScmId(), scm.getHostname(), ROLE_TYPE);
+      TracingUtil.recordExceptionInCurrentSpan(e);
       response.setSuccess(false);
       response.setStatus(exceptionToResponseStatus(e));
+      
TracingUtil.addAttributesToCurrentSpan(OzoneTracingAttributes.ERROR_STATUS, 
response.getStatus().name());

Review Comment:
   recordException**() already does setStatus, setting attribute is not useful



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMStateMachine.java:
##########
@@ -195,14 +198,18 @@ public CompletableFuture<Message> applyTransaction(
     final CompletableFuture<Message> applyTransactionFuture =
         new CompletableFuture<>();
     transactionBuffer.beginApplyingTransaction();
+    Span span = Span.getInvalid();

Review Comment:
   avoid using this, span create and end in same scope



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