rajeshkumarchandolu commented on code in PR #12145:
URL: https://github.com/apache/ozone/pull/12145#discussion_r4694908739
##########
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();
+ final Span span =
TracingUtil.createInternalSpan("PipelineManagerImpl.createPipeline");
+ TracingUtil.executeInNewSpan("PipelineManagerImpl.acquireWriteLock", () ->
acquireWriteLock());
final Pipeline pipeline;
- try {
+ try (Scope ignored = span.makeCurrent()) {
Review Comment:
Thanks. The ordering is fixed in 247e10d0e1: the lock is now acquired first,
in its own span, and the createPipeline span is created after it, so the trace
reads in code order — acquireWriteLock → createPipeline → addPipeline →
applyTransaction.
I kept the lock span as a sibling rather than moving it inside
createPipeline, because I think that gives a clearer picture: the lock wait and
the pipeline creation show up as two separate steps with their own durations,
and it keeps the existing acquireWriteLock(); try { ... } finally {
releaseWriteLock(); } structure unchanged. The safe-mode check rejects before
any pipeline work starts, and that exception is recorded on the caller's span.
--
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]