diff --git a/src/xrpld/app/ledger/detail/InboundLedger.cpp b/src/xrpld/app/ledger/detail/InboundLedger.cpp index 84f77e5d95..bb0b2ee8e0 100644 --- a/src/xrpld/app/ledger/detail/InboundLedger.cpp +++ b/src/xrpld/app/ledger/detail/InboundLedger.cpp @@ -103,12 +103,11 @@ InboundLedger::init(ScopedLockType& collectionLock) // observable. Finalized in done() with the outcome and timeout count. { using namespace telemetry; - // Detach the Scope: this guard is emplaced here but reset() on a - // JtLedgerData worker thread. Detaching strips the thread-local Scope - // so its destruction there does not corrupt this thread's context stack. + // acquireSpan_ is emplaced here but reset() on a JtLedgerData worker + // thread. A SpanGuard is thread-free (owns no thread-local Scope), so it + // can be created here and destroyed on the worker with no scope to strip. acquireSpan_.emplace( - SpanGuard::span(TraceCategory::Ledger, seg::ledger, ledger_span::op::acquire) - .detached()); + SpanGuard::span(TraceCategory::Ledger, seg::ledger, ledger_span::op::acquire)); if (*acquireSpan_) { acquireSpan_->setAttribute(ledger_span::attr::ledgerSeq, static_cast(seq_));