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


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMStateMachine.java:
##########
@@ -214,6 +220,8 @@ public CompletableFuture<Message> applyTransaction(
         // Otherwise, it's considered as a logical rejection and is returned to
         // Ratis client, leaving SCM intact.
         applyTransactionFuture.completeExceptionally(ex);
+      } finally {
+        span.end();

Review Comment:
   You're right, and my earlier wording ("so it isn't lost on exit") overstated 
it. Ending the span only hands it to the BatchSpanProcessor queue, which 
exports periodically (every 5 s by default), so a span ended just before SCM 
exits can still be lost. SCM has a JVM shutdown hook that stops the service, 
but nothing in it flushes the tracer (TracingUtil.flushTracing() exists, but 
SCM doesn't call it), so whether the failure span reaches Jaeger depends on 
timing — best case. The failure is always in the SCM log either way, and the 
test only checks what is recorded on the span, not export.
   
   Flushing the tracer from the shutdown hook is the natural fix, and it 
applies to every service rather than just SCM, so I'd handle it separately 
instead of in this PR.



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