fix(debugger): rebuild breakpoint condition when a probe stops capturing - #10159
Conversation
|
Overall package sizeSelf size: 8.85 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.4.0 | 127.33 kB | 447.04 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## watson/DEBUG-6081/guardrail-metrics #10159 +/- ##
========================================================================
- Coverage 85.90% 74.88% -11.02%
========================================================================
Files 997 992 -5
Lines 153048 152771 -277
Branches 74 59 -15
========================================================================
- Hits 131474 114404 -17070
- Misses 21574 38367 +16793
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
8eee38a to
5f64639
Compare
BenchmarksBenchmark execution time: 2026-09-06 09:22:52 Comparing candidate commit 3c4c33e in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2304 metrics, 9 unstable metrics.
|
5644b43 to
d1217f3
Compare
The breakpoint condition compiled for a location bakes in whether each probe produces snapshots. The probe sampler uses that flag to decide if a hit counts against the global snapshot rate limit, and since the guardrail metrics landed also to classify a skipped hit as a snapshot or a log event. When the pause handler hits a fatal capture error it permanently disables snapshots or capture expressions for the probe, but the breakpoint condition was never rebuilt. Such a probe kept eating into the global snapshot budget and its skipped hits kept being reported as snapshots, although every event it emitted from then on was a capture-less log event. Add `refreshBreakpoint()` to the breakpoints module, which replaces the breakpoint at a probe's location with one compiled from the current state of the probes attached to it, and call it from the pause handler once the main thread has been resumed and the results are on their way.
d1217f3 to
3c4c33e
Compare
What does this PR do?
Adds
refreshBreakpoint(probe)to the breakpoints module, which replaces the breakpoint at a probe's location with one compiled from the current state of the probes attached to it, and calls it from the pause handler once a fatal capture error has permanently disabled snapshots or capture expressions for a probe.Motivation
The breakpoint condition compiled for a location bakes in whether each probe produces snapshots. The sampler uses that flag to decide if a hit counts against the global snapshot rate limit and, since #10152, to classify a skipped hit as a snapshot or a log event. When the pause handler disabled capture for a probe the condition was never rebuilt, so such a probe kept eating into the global snapshot budget and its skipped hits kept being reported as snapshots, although every event it emitted from then on was a capture-less log event.
Additional Notes
The refresh runs after the main thread has been resumed and the results have been handed to the sender, under the same lock as the other breakpoint operations, and is a no-op for a probe that was removed in the meantime. All probes at a location share the breakpoint, so one refresh covers every probe disabled during the same pause.
The end-to-end test uses the large object safety threshold to trip the fatal error deterministically and checks that the following rate-limited hit is reported as
events.skipped{event_type:log}; it fails without the fix (event_type:snapshot).