rajeshkumarchandolu commented on code in PR #12145:
URL: https://github.com/apache/ozone/pull/12145#discussion_r4695824625
##########
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:
Span is not AutoCloseable in the OpenTelemetry API; the try-with-resources
closes the Scope, and span.end() and the exception recording stay explicit
because createActivatedSpan, which ends the span on close, cannot record the
exception. Using TracingUtil.executeInNewSpan here would mean wrapping the
whole create body in a lambda, which is more code change, so I'd keep the
current form, where creating the span and marking it as failed is
straightforward.
--
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]