Skip to content

Fix Netty client disconnects being reported as trace errors - #13113

Open
ygree wants to merge 2 commits into
masterfrom
ygree/fix-netty-closed-channel-error
Open

ygree wants to merge 2 commits into
masterfrom
ygree/fix-netty-closed-channel-error

Conversation

@ygree

@ygree ygree commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

Prevents closed-channel failures on the final Netty server response write from marking otherwise successful spans as errors.

Suppression applies only to ClosedChannelException and Netty’s StacklessClosedChannelException without an underlying cause. Existing application errors, HTTP error statuses, wrapped failures, and interruption-related exceptions remain reportable.

Motivation

#11941 began observing asynchronous response-write failures. #12295 excluded native broken-pipe and connection-reset failures, but left closed-channel client disconnects counted as trace errors even when the response status remained HTTP 200.

This extends that handling to the client-disconnect case reproduced by the regression test.

Additional Notes

  • Adds a real client-disconnect reproduction and protective test cases.

  • Validated against baseline and latest Netty dependencies.

  • Closed-channel exceptions do not identify who closed the connection, so suppression is restricted to the terminal response-write callback.

  • Backport to 1.68.x once merged

Contributor Checklist

Jira ticket: APMS-20898

@ygree ygree self-assigned this Oct 28, 2026
@ygree ygree added type: bug fix Bug fix inst: netty Netty instrumentation tag: ai generated Largely based on code generated by an AI or LLM labels Oct 28, 2026
@datadog-official

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 68.82% (+9.31%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 3cb1161 | Docs | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Oct 28, 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.84 s 14.75 s [-0.5%; +1.7%] (no difference)
startup:insecure-bank:tracing:Agent 13.59 s 13.71 s [-1.7%; -0.0%] (maybe better)
startup:petclinic:appsec:Agent 17.75 s 17.57 s [+0.0%; +2.0%] (maybe worse)
startup:petclinic:iast:Agent 17.53 s 17.67 s [-1.8%; +0.2%] (no difference)
startup:petclinic:profiling:Agent 17.62 s 17.09 s [+1.9%; +4.4%] (significantly worse)
startup:petclinic:sca:Agent 17.78 s 17.66 s [-0.5%; +1.9%] (no difference)
startup:petclinic:tracing:Agent 16.30 s 16.31 s [-6.0%; +5.9%] (unstable)

Commit: 3cb11616 · 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.

@ygree

ygree commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 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-10-29T16:18:31.629071Z 3cb1161 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-29T16:19:57.667589Z 3cb1161 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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 3cb116161a

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

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 3cb116161a

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ygree
ygree marked this pull request as ready for review October 29, 2026 16:16
@ygree
ygree requested a review from a team as a code owner October 29, 2026 16:16
@ygree
ygree requested review from ValentinZakharov and removed request for a team October 29, 2026 16:16

@datadog-official datadog-official 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: PASS

More details

Suppression is restricted to cause-free closed-channel failures on terminal response writes, preserving existing span errors, HTTP error statuses, and other exception types. Static review identified no actionable regression.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 3cb1161

@matthieulabbe

matthieulabbe commented Oct 31, 2026 •

Copy link
Copy Markdown

Tested 1.69.0-SNAPSHOT~3cb116161a in our environment and it worked as expected.

Thanks for the quick fix!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: netty Netty instrumentation tag: ai generated Largely based on code generated by an AI or LLM type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants