feat(debugger): add an evaluation time budget - #10156
Draft
watson wants to merge 1 commit into
Draft
Conversation
|
Contributor
Overall package sizeSelf size: 8.87 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/evaluation-errors #10156 +/- ##
========================================================================
+ Coverage 86.46% 98.65% +12.19%
========================================================================
Files 997 1007 +10
Lines 153305 158247 +4942
Branches 74 74
========================================================================
+ Hits 132562 156126 +23564
+ Misses 20743 2121 -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:
|
watson
force-pushed
the
watson/DEBUG-6081/evaluation-timeout
branch
2 times, most recently
from
September 4, 2026 10:24
7c30420 to
b70e96f
Compare
watson
force-pushed
the
watson/DEBUG-6081/evaluation-timeout
branch
from
September 4, 2026 12:02
b70e96f to
9dba288
Compare
watson
force-pushed
the
watson/DEBUG-6081/evaluation-timeout
branch
from
September 4, 2026 12:29
9dba288 to
253b80c
Compare
watson
force-pushed
the
watson/DEBUG-6081/evaluation-timeout
branch
from
September 4, 2026 15:41
253b80c to
7c25280
Compare
watson
force-pushed
the
watson/DEBUG-6081/evaluation-timeout
branch
from
September 6, 2026 09:05
7c25280 to
af7c8b6
Compare
Probe conditions, log message templates and capture expressions run
user-provided expressions on the application thread, and nothing
bounded how long they could take. A condition with a catastrophically
backtracking regular expression or a filter over a large collection
stalled the application on every hit.
Add `DD_DYNAMIC_INSTRUMENTATION_EVALUATION_TIMEOUT_MS` (default 10 ms,
the canonical default from the Live Debugger Circuit-Breakers RFC). V8
can't interrupt an evaluation, so the budget is enforced the way the RFC
allows for runtimes without early abort: the elapsed wall-time is
measured and an overrun is treated as guardrail input.
- Conditions are timed inside the breakpoint condition on the main
thread. An overrun is reported like a condition error (one error
result per probe per throttle window, no capture) regardless of the
condition's result, and the probe is skipped at entry for the rest of
the window. Skipped hits are counted as
`events.skipped{reason:evaluationTimeout}`.
- Templates and capture expressions are timed around their evaluation
on the paused frame in the worker. The result is still reported, with
an `evaluationErrors` entry describing the overrun, and the probe is
throttled the same way afterwards.
watson
force-pushed
the
watson/DEBUG-6081/evaluation-timeout
branch
from
September 7, 2026 10:38
af7c8b6 to
7ffa5dc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds
DD_DYNAMIC_INSTRUMENTATION_EVALUATION_TIMEOUT_MS(default 10 ms). Conditions are timed inside the breakpoint condition; an overrun is reported like a condition error regardless of the result, the probe is skipped at entry for the throttle window, and skipped hits are counted asevents.skipped{reason:evaluationTimeout}. Templates and capture expressions are timed around their evaluation on the paused frame; the result is still sent with anevaluationErrorsentry and the probe is throttled afterwards.Motivation
Nothing bounded how long user expressions could run on the application thread. V8 can't interrupt an evaluation, so this measures wall-time and treat overruns as guardrail input. Enables
Test_Debugger_Evaluation_Timeout_Line_Probein system tests.Additional Notes
The end-to-end test uses a ReDoS regex condition: the first hit paid ~900 ms once, the following hits were skipped at probe entry in ~7 ms each.