sumitagrawl commented on code in PR #12145:
URL: https://github.com/apache/ozone/pull/12145#discussion_r4693608412
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManagerImpl.java:
##########
@@ -221,9 +224,10 @@ public Pipeline createPipeline(ReplicationConfig
replicationConfig,
throws IOException {
checkIfPipelineCreationIsAllowed(replicationConfig);
- acquireWriteLock();
+ TracingUtil.executeInNewSpan("PipelineManagerImpl.acquireWriteLock", () ->
acquireWriteLock());
Review Comment:
we do not need create space for taking lock
##########
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.STATUS,
response.getStatus().name());
Review Comment:
span.setStatus() is used to mark if success or failure, we should not use
other way to represent same
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/protocol/SecretKeyProtocolServerSideTranslatorPB.java:
##########
@@ -117,8 +119,10 @@ 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.STATUS,
scmSecurityResponse.getStatus().name());
Review Comment:
we need use span.setStatus()
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/protocol/SCMSecurityProtocolServerSideTranslatorPB.java:
##########
@@ -150,8 +152,10 @@ 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.STATUS,
scmSecurityResponse.getStatus().name());
Review Comment:
we need use span.setStatus()
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManagerImpl.java:
##########
@@ -221,9 +224,10 @@ public Pipeline createPipeline(ReplicationConfig
replicationConfig,
throws IOException {
checkIfPipelineCreationIsAllowed(replicationConfig);
- acquireWriteLock();
+ TracingUtil.executeInNewSpan("PipelineManagerImpl.acquireWriteLock", () ->
acquireWriteLock());
+ final Span span =
TracingUtil.createInternalSpan("PipelineManagerImpl.createPipeline");
final Pipeline pipeline;
- try {
+ try (Scope ignored = span.makeCurrent()) {
Review Comment:
try-with-resouce may close span implicitly, check if works to handle
span.end() or record excpetion
--
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]