Skip to content

Fix memory leak on roadrunner/frankenphp/etc due to appsec telemetry#4061

Open
cataphract wants to merge 2 commits into
masterfrom
glopes/fix-leak-user-req-tel
Open

Fix memory leak on roadrunner/frankenphp/etc due to appsec telemetry#4061
cataphract wants to merge 2 commits into
masterfrom
glopes/fix-leak-user-req-tel

Conversation

@cataphract

Copy link
Copy Markdown
Contributor

Description

During "user request mode" (one of FrankenPHP's modes, roadrunner, etc.), the telemetry buffer would grow at constant rate of 300 bytes/req, never being drained, draining would only happen at rshutdown

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@cataphract
cataphract requested a review from a team as a code owner July 24, 2026 15:15
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 24, 2026

Copy link
Copy Markdown

Pipelines  Tests

Unblock PR with BitsAI

⚠️ Warnings

🚦 35 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | PHP Language Tests: [7.1]   View in Datadog   GitLab

🧪 2 Tests failed

All test failures are known flaky.

❄️ Known flaky: opendir-003.phpt - opendir() with 'ftps://' stream. from php-src.php-src.ext.standard.tests.streams   View in Datadog
002+ error:0A000086:SSL routines::certificate verify failed in /usr/local/src/php/ext/standard/tests/streams/opendir-003.php on line 10
003+ 
002-  in %s on line %d
007+ 
009+ error:0A000415:SSL routines::sslv3 alert certificate expired in /usr/local/src/php/ext/ftp/tests/server.inc on line 121
010+ SSLv23 handshake failed.

Not introduced in this PR.

❄️ Known flaky: opendir-004.phpt - opendir() with 'ftps://' stream. from php-src.php-src.ext.standard.tests.streams   View in Datadog
002+ error:0A000086:SSL routines::certificate verify failed in /usr/local/src/php/ext/standard/tests/streams/opendir-004.php on line 10
003+ 
005+ error:0A000415:SSL routines::sslv3 alert certificate expired in /usr/local/src/php/ext/ftp/tests/server.inc on line 121
006+ SSLv23 handshake failed.
007+ 
009+ bool(false)
010+ 
001- resource(%d) of type (stream)
002- string(5) "file1"
003- string(5) "file1"
...

Not introduced in this PR.

DataDog/apm-reliability/dd-trace-php | PHP Language Tests: [7.3]   View in Datadog   GitLab

🧪 1 Test failed

All test failures are known flaky.

❄️ Known flaky: opendir() with 'ftps://' stream. from PHP.ext.standard.tests.streams   View in Datadog
002+ error:0A000086:SSL routines::certificate verify failed in /usr/local/src/php/ext/standard/tests/streams/opendir-004.php on line 10
003+ 
005+ bool(false)
006+ 
001- resource(%d) of type (stream)
002- string(5) "file1"
003- string(5) "file1"
004- string(3) "fil"
005- string(4) "b0rk"
009+ 
...

Not introduced in this PR.

DataDog/apm-reliability/dd-trace-php | PHP Language Tests: [8.0]   View in Datadog   GitLab

🧪 2 Tests failed

All test failures are known flaky.

❄️ Known flaky: ext/standard/tests/streams/opendir-003.phpt (opendir() with 'ftps://' stream.) from PHP.ext.standard.tests.streams   View in Datadog
002+ error:0A000086:SSL routines::certificate verify failed in /usr/local/src/php/ext/standard/tests/streams/opendir-003.php on line 10
003+ 
005+ error:0A000415:SSL routines::sslv3 alert certificate expired in /usr/local/src/php/ext/ftp/tests/server.inc on line 115
006+ SSLv23 handshake failed.
007+ 
002-  in %s on line %d
     bool(false)

Not introduced in this PR.

❄️ Known flaky: ext/standard/tests/streams/opendir-004.phpt (opendir() with 'ftps://' stream.) from PHP.ext.standard.tests.streams   View in Datadog
002+ error:0A000415:SSL routines::sslv3 alert certificate expired in /usr/local/src/php/ext/ftp/tests/server.inc on line 115
003+ 
005+ error:0A000086:SSL routines::certificate verify failed in /usr/local/src/php/ext/standard/tests/streams/opendir-004.php on line 10
001- resource(%d) of type (stream)
002- string(5) "file1"
003- string(5) "file1"
004- string(3) "fil"
005- string(4) "b0rk"
006+ SSLv23 handshake failed.
007+ 
...

Not introduced in this PR.

View all 35 failed jobs.

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

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

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: c18198c | Docs | Datadog PR Page | Give us feedback!

@bwoebi bwoebi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks right!

@pr-commenter

pr-commenter Bot commented Jul 24, 2026

Copy link
Copy Markdown

Benchmarks [ tracer ]

Benchmark execution time: 2026-07-24 19:07:21

Comparing candidate commit c18198c in PR branch glopes/fix-leak-user-req-tel with baseline commit f068c9e in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 194 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 ----------------------------------'

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.

2 participants