|
185 | 185 | | 2.6 | Build verification and performance baseline | 0 | 0 | 2.1-2.5 | |
186 | 186 |
|
187 | 187 | **Parallel work**: Tasks 2.1, 2.2, 2.3 can run in parallel. Task 2.4 depends on 2.3. Task 2.5 can run in parallel with 2.4. Task 2.6 depends on all others. |
| 188 | + |
| 189 | +--- |
| 190 | + |
| 191 | +## Known Issues / Future Work |
| 192 | + |
| 193 | +### Thread safety of TelemetryImpl::stop() vs startSpan() |
| 194 | + |
| 195 | +`TelemetryImpl::stop()` resets `sdkProvider_` (a `std::shared_ptr`) without |
| 196 | +synchronization. `getTracer()` reads the same member from RPC handler threads. |
| 197 | +This is a data race if any thread calls `startSpan()` concurrently with `stop()`. |
| 198 | + |
| 199 | +**Current mitigation**: `Application::stop()` shuts down `serverHandler_`, |
| 200 | +`overlay_`, and `jobQueue_` before calling `telemetry_->stop()`, so no callers |
| 201 | +remain. See comments in `Telemetry.cpp:stop()` and `Application.cpp`. |
| 202 | + |
| 203 | +**TODO**: Add an `std::atomic<bool> stopped_` flag checked in `getTracer()` to |
| 204 | +make this robust against future shutdown order changes. |
| 205 | + |
| 206 | +### Macro incompatibility: XRPL_TRACE_SPAN vs XRPL_TRACE_SET_ATTR |
| 207 | + |
| 208 | +`XRPL_TRACE_SPAN` and `XRPL_TRACE_SPAN_KIND` declare `_xrpl_guard_` as a bare |
| 209 | +`SpanGuard`, but `XRPL_TRACE_SET_ATTR` and `XRPL_TRACE_EXCEPTION` call |
| 210 | +`_xrpl_guard_.has_value()` which requires `std::optional<SpanGuard>`. Using |
| 211 | +`XRPL_TRACE_SPAN` followed by `XRPL_TRACE_SET_ATTR` in the same scope would |
| 212 | +fail to compile. |
| 213 | + |
| 214 | +**Current mitigation**: No call site currently uses `XRPL_TRACE_SPAN` — all |
| 215 | +production code uses the conditional macros (`XRPL_TRACE_RPC`, `XRPL_TRACE_TX`, |
| 216 | +etc.) which correctly wrap the guard in `std::optional`. |
| 217 | + |
| 218 | +**TODO**: Either make `XRPL_TRACE_SPAN`/`XRPL_TRACE_SPAN_KIND` also wrap in |
| 219 | +`std::optional`, or document that `XRPL_TRACE_SET_ATTR` is only compatible with |
| 220 | +the conditional macros. |
0 commit comments