mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-21 14:20:56 +00:00
rpcStart, jobQueue, jobStart and jobFinish each acquired a lock without braces, so it stayed held to the end of the function and covered the OTel recording calls this branch added. counters_.jobsMutex and counters_.methodsMutex are process-wide, so every worker thread starting or finishing a job serialised on the SDK's work. That work is not a bare atomic add: each record builds a map-backed attribute set and takes a spin lock inside the SDK, whose backoff reaches a millisecond-scale sleep under contention. Brace the lock plus the state it guards, then record after it releases. None of the metric calls read lock-protected state, so this is semantics-preserving, and rpcEnd() in the same file already had this shape.