Add timeout to debugger captures#4003
Conversation
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 793daeec61
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| usec = dd_find_lowest_dealine_timer(); | ||
| #endif | ||
| struct itimerval it = { | ||
| .it_value = { .tv_sec = usec / 10000000, .tv_usec = usec % 1000000 }, |
There was a problem hiding this comment.
Use microseconds-per-second for setitimer
On the non-Linux setitimer path, usec is already in microseconds, so tv_sec must divide by 1,000,000 rather than 10,000,000. When DD_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT_MS is configured above 999 ms on macOS/BSD, values like 1000 ms or 2000 ms produce {0, 0} and disarm the timeout, while other multi-second values fire much too early; the same conversion should be fixed in the stop/re-arm paths as well.
Useful? React with 👍 / 👎.
Benchmarks [ tracer ]Benchmark execution time: 2026-06-22 12:35:55 Comparing candidate commit 793daee in PR branch Found 2 performance improvements and 0 performance regressions! Performance is the same for 191 metrics, 1 unstable metrics.
|
Adding
DD_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT_MSconfig to enforce limits on capture times.