Skip to content

Add timeout check during Matches expression eval - #12832

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
masterfrom
jpbempel/add-timeout-in-matches-expr
Oct 14, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
masterfrom
jpbempel/add-timeout-in-matches-expr

Conversation

@jpbempel

@jpbempel jpbempel commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

What Does This Do

In case of very expensive regex matching (like a backtracking one) timeout is not evaluated and only at the end of the evaluation. Using a CharSequence wrapper we can interleave a timeout check while accessing char through CharSequence::charAt(). regex expressions are also pre-compiled while before they was compiled
for each evaluation.

Motivation

Additional Notes

Contributor Checklist

Jira ticket: DEBUG-6247

@jpbempel
jpbempel requested a review from a team as a code owner October 12, 2026 14:46
@jpbempel
jpbempel requested review from dudikeleti and removed request for a team October 12, 2026 14:46
@jpbempel jpbempel added the comp: debugger Dynamic Instrumentation label Oct 12, 2026
@dd-octo-sts

dd-octo-sts Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T14:51:25.091103Z 7e7d696 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@jpbempel jpbempel added the type: bug fix Bug fix label Oct 12, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e7d696fe8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@datadog-prod-us1-5 datadog-prod-us1-5 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: FAIL

In CPU timeout mode, per-character CPU-time queries can make ordinary linear regex matches exhaust the 50 ms evaluation budget and suppress log-probe snapshots.

Open Bits AI session

🤖 Bits Code Review · Commit 7e7d696

@datadog-prod-us1-5

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.01 s 13.91 s [-0.1%; +1.5%] (no difference)
startup:insecure-bank:tracing:Agent 12.87 s 12.99 s [-1.5%; -0.3%] (maybe better)
startup:petclinic:appsec:Agent 17.22 s 17.09 s [-0.0%; +1.5%] (no difference)
startup:petclinic:iast:Agent 16.89 s 17.01 s [-1.5%; +0.1%] (no difference)
startup:petclinic:profiling:Agent 16.45 s 16.89 s [-3.7%; -1.6%] (significantly better)
startup:petclinic:sca:Agent 17.08 s 17.09 s [-1.0%; +0.8%] (no difference)
startup:petclinic:tracing:Agent 15.60 s 16.16 s [-7.6%; +0.7%] (no difference)

Commit: 9572645e · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@pr-commenter

pr-commenter Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Debugger benchmarks

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
ci_job_date 1791961238 1791961565
end_time 2026-10-14T07:02:06 2026-10-14T07:07:33
git_branch master jpbempel/add-timeout-in-matches-expr
git_commit_sha 0e86410 9572645
start_time 2026-10-14T07:00:39 2026-10-14T07:06:06
See matching parameters
Baseline Candidate
ci_job_id 2136409532 2136409532
ci_pipeline_id 144523581 144523581
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
git_commit_date 1791960619 1791960619

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 9 metrics, 6 unstable metrics.

See unchanged results
scenario Δ mean agg_http_req_duration_min Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p75 Δ mean agg_http_req_duration_p99 Δ mean throughput
scenario:noprobe unstable
[-41.032µs; +24.133µs] or [-12.625%; +7.426%]
unstable
[-55.445µs; +34.925µs] or [-15.376%; +9.686%]
unstable
[-67.606µs; +44.271µs] or [-17.944%; +11.750%]
unstable
[-144982.888ns; +143774.194ns] or [-12.738%; +12.632%]
same
scenario:basic same same same unstable
[-83.675µs; +162.394µs] or [-7.895%; +15.323%]
unstable
[-165.371op/s; +165.371op/s] or [-7.276%; +7.276%]
scenario:loop same same same same same
Request duration reports for reports
gantt
    title reports - request duration [CI 0.99] : candidate=None, baseline=None
    dateFormat X
    axisFormat %s
section baseline
noprobe (360.589 µs) : 312, 410
.   : milestone, 361,
basic (328.958 µs) : 323, 335
.   : milestone, 329,
loop (8.116 ms) : 8044, 8188
.   : milestone, 8116,
section candidate
noprobe (350.329 µs) : 314, 386
.   : milestone, 350,
basic (328.857 µs) : 323, 335
.   : milestone, 329,
loop (8.099 ms) : 8036, 8162
.   : milestone, 8099,
Loading
  • baseline results
Scenario Request median duration [CI 0.99]
noprobe 360.589 µs [311.591 µs, 409.588 µs]
basic 328.958 µs [323.292 µs, 334.625 µs]
loop 8.116 ms [8.044 ms, 8.188 ms]
  • candidate results
Scenario Request median duration [CI 0.99]
noprobe 350.329 µs [314.478 µs, 386.181 µs]
basic 328.857 µs [322.953 µs, 334.76 µs]
loop 8.099 ms [8.036 ms, 8.162 ms]

@dudikeleti dudikeleti left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, two nits:

  1. If the regex fails to compile in the constructor, does that throw and fail the probe instead of returning an evaluation error?

  2. Did you consider 1024 char check instead of 256?

@jpbempel

Copy link
Copy Markdown
Member Author

LGTM, two nits:

  1. If the regex fails to compile in the constructor, does that throw and fail the probe instead of returning an evaluation error?

it fails at deserialization from the json coming from RC so it will fail the whole probe definition back to RC. which makes sense here if the regex is not valid.

  1. Did you consider 1024 char check instead of 256?

no, but testing around that, show me that I can push to 4096 to amortize the cost of the check

@jpbempel
jpbempel added this pull request to the merge queue Oct 13, 2026
@dd-octo-sts

dd-octo-sts Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-10-13 14:40:03 UTC ℹ️ Start processing command /merge


2026-10-13 14:40:07 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-10-13 15:26:51 UTC ❌ MergeQueue: The build pipeline contains failing jobs for this merge request

Build pipeline has failing jobs for 29189fa:

⚠️ Do NOT retry failed jobs directly (why?).

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • If your PR checks are green, try to rebase/merge. It might be because the CI run is a bit old.
  • Any question, go check the FAQ.
Details

Since those jobs are not marked as being allowed to fail, the pipeline will most likely fail.
Therefore, and to allow other builds to be processed, this merge request has been rejected and the pipeline got canceled.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 13, 2026
In case of very expensive regex matching (like a backtracking one)
timeout is not evaluated and only at the end of the evaluation.
Using a CharSequence wrapper we can interleave a timeout check
while accessing char through CharSequence::charAt().
regex expression are also pre-compiled while before they was compiled
 for each evaluation.
@jpbempel
jpbempel force-pushed the jpbempel/add-timeout-in-matches-expr branch from e537d6e to c8bc037 Compare October 14, 2026 05:52
@jpbempel
jpbempel added this pull request to the merge queue Oct 14, 2026
@dd-octo-sts

dd-octo-sts Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-10-14 08:14:03 UTC ℹ️ Start processing command /merge


2026-10-14 08:14:09 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-10-14 09:25:32 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 14, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 5ea7911 into master Oct 14, 2026
618 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the jpbempel/add-timeout-in-matches-expr branch October 14, 2026 09:25
@github-actions github-actions Bot added this to the 1.68.0 milestone Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: debugger Dynamic Instrumentation type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants