[Debugger] Avoid noisy async state machine metadata warnings#8761
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reduces noisy native debugger logs during hot-standby module scans by avoiding metadata API calls that are invalid for non-mdtTypeRef interface tokens and by downgrading remaining unexpected metadata-resolution logs from Warn to Debug.
Changes:
- Treats non-
TypeRefInterfaceImpl.Interfacetokens as a normal non-match forIAsyncStateMachine(returnsS_OK+false, no log). - Lowers diagnostics for unexpected
GetTypeRefPropsfailures (and the caller’s failure log) fromWarntoDebug. - Adds clarifying comments explaining why non-
TypeReftokens are expected/benign in this path.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tracer/src/Datadog.Tracer.Native/debugger_probes_instrumentation_requester.cpp | Downgrades helper-failure logging from Warn to Debug in hot-standby scanning. |
| tracer/src/Datadog.Tracer.Native/debugger_method_rewriter.cpp | Skips GetTypeRefProps for non-mdtTypeRef interface tokens and downgrades remaining diagnostics to Debug. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8761) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8761) - mean (74ms) : 70, 77
master - mean (74ms) : 70, 79
section Bailout
This PR (8761) - mean (80ms) : 75, 84
master - mean (77ms) : 75, 80
section CallTarget+Inlining+NGEN
This PR (8761) - mean (1,112ms) : 1053, 1171
master - mean (1,106ms) : 1050, 1161
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8761) - mean (117ms) : 110, 123
master - mean (114ms) : 108, 121
section Bailout
This PR (8761) - mean (116ms) : 111, 120
master - mean (113ms) : 111, 116
section CallTarget+Inlining+NGEN
This PR (8761) - mean (798ms) : 766, 830
master - mean (793ms) : 760, 825
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8761) - mean (102ms) : 97, 106
master - mean (101ms) : 98, 105
section Bailout
This PR (8761) - mean (102ms) : 99, 105
master - mean (102ms) : 99, 105
section CallTarget+Inlining+NGEN
This PR (8761) - mean (948ms) : 901, 996
master - mean (948ms) : 905, 991
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8761) - mean (102ms) : 97, 108
master - mean (101ms) : 96, 106
section Bailout
This PR (8761) - mean (103ms) : 97, 108
master - mean (100ms) : 97, 102
section CallTarget+Inlining+NGEN
This PR (8761) - mean (822ms) : 790, 855
master - mean (824ms) : 778, 869
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8761) - mean (200ms) : 195, 204
master - mean (196ms) : 192, 200
section Bailout
This PR (8761) - mean (203ms) : 200, 206
master - mean (200ms) : 196, 203
section CallTarget+Inlining+NGEN
This PR (8761) - mean (1,204ms) : 1139, 1269
master - mean (1,196ms) : 1159, 1232
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8761) - mean (288ms) : 282, 294
master - mean (285ms) : 278, 292
section Bailout
This PR (8761) - mean (289ms) : 284, 293
master - mean (283ms) : 277, 290
section CallTarget+Inlining+NGEN
This PR (8761) - mean (968ms) : 947, 990
master - mean (956ms) : 934, 979
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8761) - mean (278ms) : 272, 284
master - mean (276ms) : 269, 283
section Bailout
This PR (8761) - mean (280ms) : 274, 285
master - mean (275ms) : 270, 280
section CallTarget+Inlining+NGEN
This PR (8761) - mean (1,157ms) : 1125, 1190
master - mean (1,161ms) : 1128, 1194
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8761) - mean (275ms) : 268, 281
master - mean (277ms) : 268, 287
section Bailout
This PR (8761) - mean (275ms) : 269, 281
master - mean (276ms) : 270, 283
section CallTarget+Inlining+NGEN
This PR (8761) - mean (1,034ms) : 995, 1074
master - mean (1,038ms) : 993, 1083
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BenchmarksBenchmark execution time: 2026-06-05 16:09:35 Comparing candidate commit e96469a in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 71 metrics, 0 unstable metrics, 59 known flaky benchmarks, 67 flaky benchmarks without significant changes.
|
## Summary of changes - Avoids noisy debugger native logs during Dynamic Instrumentation / Exception Replay hot-standby module scans. - Treats non-`TypeRef` interface tokens as “not `IAsyncStateMachine`” instead of attempting `GetTypeRefProps` on tokens that cannot be resolved that way. - Lowers the remaining unexpected metadata-resolution diagnostics from `Warn` to `Debug`. ## Reason for change - A customer reported large volumes of native tracer logs after upgrading from `3.20.1` to `3.43.0`. - The logs came from the debugger hot-standby path, even though Dynamic Instrumentation / Exception Replay were not actively being used. - The noisy case is benign: `InterfaceImpl.Interface` is a `TypeDefOrRef` coded token, and `TypeDef` / `TypeSpec` values are normal metadata shapes for other interfaces. ## Implementation details - `IAsyncStateMachine` is imported from corelib for debugger-instrumented application modules, so the expected token kind is `mdtTypeRef`. - If the interface token is not a `TypeRef`, the helper now returns `S_OK` with `isTypeImplementIAsyncStateMachine = false` without logging. - If the token is a `TypeRef` but `GetTypeRefProps` still fails, we keep a diagnostic log at `Debug`. - The hot-standby caller also logs remaining helper failures at `Debug`, since the common non-`TypeRef` case is now handled as a normal non-match.
Summary of changes
TypeRefinterface tokens as “notIAsyncStateMachine” instead of attemptingGetTypeRefPropson tokens that cannot be resolved that way.WarntoDebug.Reason for change
3.20.1to3.43.0.InterfaceImpl.Interfaceis aTypeDefOrRefcoded token, andTypeDef/TypeSpecvalues are normal metadata shapes for other interfaces.Implementation details
IAsyncStateMachineis imported from corelib for debugger-instrumented application modules, so the expected token kind ismdtTypeRef.TypeRef, the helper now returnsS_OKwithisTypeImplementIAsyncStateMachine = falsewithout logging.TypeRefbutGetTypeRefPropsstill fails, we keep a diagnostic log atDebug.Debug, since the common non-TypeRefcase is now handled as a normal non-match.