Skip to content

Commit

Permalink
HBASE-26759 Fix orphaned RegionScanner.close spans
Browse files Browse the repository at this point in the history
We appear to be generating spans with without a parent context with the name
`RegionScanner.close`.
  • Loading branch information
ndimiduk committed Feb 28, 2022
1 parent ef98875 commit 4cc2aa4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

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

0 comments on commit 4cc2aa4

Please sign in to comment.