Skip to content

Commit 4780035

Browse files
committed
HBASE-26759 Fix orphaned RegionScanner.close spans
We appear to be generating spans with without a parent context with the name `RegionScanner.close`.
1 parent cd45cad commit 4780035

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ServerCall.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import io.opentelemetry.api.trace.Span;
2121
import io.opentelemetry.api.trace.StatusCode;
22+
import io.opentelemetry.context.Scope;
2223
import java.io.IOException;
2324
import java.net.InetAddress;
2425
import java.nio.ByteBuffer;
@@ -299,11 +300,12 @@ public synchronized void setResponse(Message m, final CellScanner cells, Throwab
299300
// Once a response message is created and set to this.response, this Call can be treated as
300301
// done. The Responder thread will do the n/w write of this message back to client.
301302
if (this.rpcCallback != null) {
302-
try {
303+
try (Scope ignored = span.makeCurrent()) {
303304
this.rpcCallback.run();
304305
} catch (Exception e) {
305306
// Don't allow any exception here to kill this handler thread.
306307
RpcServer.LOG.warn("Exception while running the Rpc Callback.", e);
308+
TraceUtil.setError(span, e);
307309
}
308310
}
309311
}

0 commit comments

Comments
 (0)