feat(debugger): report condition evaluation errors - #10155
Conversation
Overall package sizeSelf size: 8.86 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/bounded-queues #10155 +/- ##
=====================================================================
- Coverage 98.65% 86.46% -12.19%
=====================================================================
Files 1007 997 -10
Lines 157914 153305 -4609
Branches 74 74
=====================================================================
- Hits 155793 132562 -23231
- Misses 2121 20743 +18622
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:
|
5b0dd17 to
dad9b24
Compare
dad9b24 to
8b7e432
Compare
8b7e432 to
8278842
Compare
2d0b3cc to
8f129ba
Compare
8f129ba to
017d35b
Compare
A probe whose condition threw was silently treated as not matching, so a broken condition (a typo in a variable name, a member access on an undefined value, ...) left the user with a probe that never fires and no explanation. The condition was also evaluated again, and threw again, on every single hit. Condition errors are now handled like the other tracers do it: the probe result carries the error in `evaluationErrors` (with the condition DSL as `expr` and the error as `message`) and nothing is captured, so the user can see why the probe is not producing regular results. Error results bypass the per-probe and global rate limits, and are instead limited by a per-probe throttle: after an error the condition is not evaluated again for five minutes, and one error result is reported per window. This also bounds the cost of a condition that is expensive to fail. The probe sampler records the error on the main thread and flags the sampled probe index, so the worker knows to fetch the error from the paused frame instead of capturing a snapshot.
017d35b to
2f97506
Compare
What does this PR do?
A probe whose condition throws now emits an error-only result (
evaluationErrorswith the condition DSL and the error message, no captures) instead of being silently treated as "not matched". Error results bypass the rate limits and are throttled instead: after an error the condition is not evaluated again for five minutes and one error result is reported per window.Motivation
Users had no way to see why a probe with a typo in its condition never fired, and the failing condition was re-evaluated on every hit. Matches the .NET/Python behaviour and the
Test_Debugger_Runtime_Condition_Errorsystem tests.Additional Notes
The sampler records the error on the main thread and flags the sampled index (
CONDITION_ERROR_FLAG), so the worker fetches the error from the paused frame instead of capturing. Twodiagnostics.spec.jscases that used an undefined variable as a "false" condition were updated.