Skip to content

Fix repeated web server error log failures - #4254

Merged
bwoebi merged 5 commits into
masterfrom
fix/consume-webserver-error-log
Oct 6, 2026
Merged

bwoebi merged 5 commits into
masterfrom
fix/consume-webserver-error-log

Conversation

@cgcote

@cgcote cgcote commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • consume newly written web-server error log entries after each check
  • reset the read offset when the log is truncated or rotated
  • add regression coverage for one-time consumption and truncation

Root cause

WebServer::checkErrors() always read from the offset captured when the server started, but never advanced that offset. A single transient error was therefore reported by every retry and every subsequent test sharing the server. In Symfony 6.2, this amplified one error into synchronized failures across the four automated login-event tests.

CI Visibility evidence

Aggregated default-branch data for the previous 14 days showed 416 Symfony 6.2 known-flaky failures across 8 commits:

  • testLoggedInCalls: 104 failures
  • testUserLoginFailureEvent: 104 failures
  • testUserLoginSuccessEvent: 104 failures
  • testUserSignUp: 104 failures

Each affected commit had the same failure count for all four tests. The failures spanned every PHP 8.3 web-server SAPI (148 apache2handler, 128 cgi-fcgi, and 140 cli-server) and shared the Got error from webserver: signature at WebFrameworkTestCase.php:74. This synchronized shape supports a shared harness-state problem rather than four independent Symfony assertions.

The same signature also appeared at much lower volume in Swoole (68 events) and FrankenPHP (6 events), confirming that the underlying behavior is generic to the web-server harness and is simply most visible in Symfony.

CI Visibility for this PR reports all instrumented tests passing, no new flaky tests, 100% patch coverage, and no code-quality or security findings.

Validation

Red before / green after

The same deterministic PHP 8.3 check was run against the committed pre-fix implementation and this change:

RED — pre-fix
first='[ddtrace] [error] transient error'
second='[ddtrace] [error] transient error'
exit=1

GREEN — fixed
first='[ddtrace] [error] transient error'
second=NULL
exit=0

Tests

  • focused unit test: 2 tests, 6 assertions
  • Symfony 6.2: 30/30 suite runs passed
  • 10 runs each with cli-server, cgi-fcgi, and apache2handler
  • 120/120 executions of the four historically flaky tests passed (570 assertions)
  • PHP syntax checks and git diff --check passed

@cgcote
cgcote requested review from a team as code owners September 30, 2026 17:29
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

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

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 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-02T07:49:25.473402Z 5df4f42 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-02T07:49:22.495140Z 5df4f42 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: 5df4f429e0

ℹ️ 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 tests/WebServer.php Outdated
@cgcote
cgcote marked this pull request as draft September 30, 2026 17:49
@cgcote
cgcote marked this pull request as ready for review October 2, 2026 07:45

@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: 5df4f429e0

ℹ️ 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 tests/WebServer.php
@cgcote

cgcote commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

/gitlab retry-pipeline

@gh-worker-devflow-routing-ef8351

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

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-10-02 08:02:05 UTC ℹ️ Start processing command /gitlab retry-pipeline


2026-10-02 08:03:34 UTC ℹ️ Devflow: /gitlab retry-pipeline

All failed jobs have been retried successfully. The following job IDs have been retried: 2102078658, 2102078822, 2102079357, 2102079579

@cgcote

cgcote commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

/gitlab retry-pipeline

@gh-worker-devflow-routing-ef8351

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

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-10-02 08:03:36 UTC ℹ️ Start processing command /gitlab retry-pipeline


2026-10-02 08:04:50 UTC ℹ️ Devflow: /gitlab retry-pipeline

All failed jobs have been retried successfully. The following job IDs have been retried:

cgcote and others added 4 commits October 2, 2026 09:23
A size-only comparison misses a rotated/replaced error log whose
replacement has already grown to at least the previous offset, causing
checkErrors() to skip entries at the beginning of the new file. Track
the log's inode in addition to its size and reset the cursor whenever
either changes.
@bwoebi

bwoebi commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Thanks!

@bwoebi
bwoebi merged commit a907dfa into master Oct 6, 2026
2185 checks passed
@bwoebi
bwoebi deleted the fix/consume-webserver-error-log branch October 6, 2026 18:05
@github-actions github-actions Bot added this to the 1.26.0 milestone Oct 6, 2026
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