fix(tracer): add null guard clause in sidecar reconnect callback#3499
fix(tracer): add null guard clause in sidecar reconnect callback#3499
Conversation
Benchmarks [ tracer ]Benchmark execution time: 2025-11-28 15:42:04 Comparing candidate commit 35e6a4e in PR branch Found 1 performance improvements and 4 performance regressions! Performance is the same for 186 metrics, 3 unstable metrics. scenario:SamplingRuleMatchingBench/benchRegexMatching1
scenario:SamplingRuleMatchingBench/benchRegexMatching3
scenario:SamplingRuleMatchingBench/benchRegexMatching4
scenario:SpanBench/benchOpenTelemetryAPI
scenario:TraceSerializationBench/benchSerializeTrace
|
Signed-off-by: Alexandre Rulleau <[email protected]>
b90299d to
6122feb
Compare
realFlowControl
left a comment
There was a problem hiding this comment.
Nice catch!
I have a comment which is just lack of knowledge about this part of the code, otherwise it looks fine to me.
| if (!ddtrace_endpoint || !dogstatsd_endpoint) { | ||
| return; | ||
| } | ||
|
|
There was a problem hiding this comment.
The dd_sidecar_connection_factory_ex function uses another pattern:
Lines 161 to 165 in 6122feb
I am not 100% certain why a ZEND_ASSERT is sufficient below, but most likely because ddtrace_endpoint and dogstatsd_endpoint should be kept in sync anyway.
So maybe this is just fine ..
There was a problem hiding this comment.
Yeah this is the original reason this was put there i believe
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3499 +/- ##
==========================================
+ Coverage 61.69% 61.71% +0.01%
==========================================
Files 142 142
Lines 12923 12923
Branches 1695 1695
==========================================
+ Hits 7973 7975 +2
+ Misses 4196 4193 -3
- Partials 754 755 +1 see 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Description
Fixes a use-after-free crash in sidecar shutdown that occurs when the reconnect callback is invoked after endpoints have been freed.
Related Jiras: APMS-17794