Skip to content

Make forced signal flush raw-clone safe - #4222

Open
cataphract wants to merge 3 commits into
masterfrom
glopes/flush-worker-crash
Open

cataphract wants to merge 3 commits into
masterfrom
glopes/flush-worker-crash

Conversation

@cataphract

@cataphract cataphract commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Avoid allocation crashes in the flush worker launched by the sigterm/sigint handler.

Prepare an independent sidecar connection and serialized flush request before signal delivery. The SIGINT and SIGTERM handler starts a one-shot raw clone that uses audited direct syscalls while waiting for an ACK or timeout, avoiding libc and allocator state in the unrepaired clone.

Track worker lifetime with lock-free the kernel clear_child_tid futex protocol.

See also the internal 2a04c87e-b050-11f1-bb9c-da7ad0900002 in error telemetry, among others.

Prepare an independent sidecar connection and serialized flush request
before signal delivery. The SIGINT and SIGTERM handler starts a one-shot
raw clone that uses audited direct syscalls while waiting for an ACK or
timeout, avoiding libc and allocator state in the unrepaired clone.

Track worker lifetime with lock-free the kernel clear_child_tid futex protocol.
@datadog-official

datadog-official Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

✨ Unblock PR with BitsAI

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 10 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | test_web_drupal_101: [8.2, cgi-fcgi] — ❄️ 2 known flaky tests

View more details · View in GitLab

↳ ❄️ Known flaky: testScenarioGetToMissingRoute from tests/Integrations/Drupal/V10_1.DDTrace\Tests\Integrations\Drupal\V10_1\CommonScenariosTest

↳ ❄️ Known flaky: testScenarioGetWithView from tests/Integrations/Drupal/V10_1.DDTrace\Tests\Integrations\Drupal\V10_1\CommonScenariosTest

DataDog/apm-reliability/dd-trace-php | benchmarks-tracer — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

DataDog/apm-reliability/dd-trace-php | test_extension_ci: [8.5] — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

View all 10 failed jobs.

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 68.26% (+0.00%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 4db9916 | Docs | View more details | Give us feedback!

@pr-commenter

pr-commenter Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Benchmarks [ tracer ]

Benchmark execution time: 2026-09-28 10:39:49

Comparing candidate commit 484285f in PR branch glopes/flush-worker-crash with baseline commit 5fe256c in branch master.

📊 Benchmarking dashboard

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

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:SamplingRuleMatchingBench/benchRegexMatching1

  • 🟥 execution_time [+48.947ns; +123.853ns] or [+3.355%; +8.490%]

@cataphract
cataphract marked this pull request as ready for review September 28, 2026 13:56
@cataphract
cataphract requested review from a team as code owners September 28, 2026 13:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 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-09-28T14:01:05.160467Z 785f205 Draft marked ready
🔒 Security Review ✅ Completed 2026-09-28T14:05:19.811295Z 785f205 Draft marked ready
ℹ️ 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.

@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: 785f2051ba

ℹ️ 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".

Comment thread Makefile
A sidecar restart left the prepared signal socket stale after the
normal transport recovered, so forced shutdown could skip its flush.

Refresh the socket from the replacement transport while it is still
unclaimed. Publish before freeing the retired object so cross-thread
signals cannot deadlock on allocator state.
@cataphract
cataphract force-pushed the glopes/flush-worker-crash branch from 785f205 to 4db9916 Compare September 28, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant