Skip to content

Prevent Akka HTTP timeout cleanup from retaining request context - #12615

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
andrea.marziali/akka-http-timeout-cleanup-context
Sep 25, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
andrea.marziali/akka-http-timeout-cleanup-context

Conversation

@amarziali

Copy link
Copy Markdown
Contributor

What Does This Do

Disable async context capture only while TimeoutAccessImpl.clear() registers its timeout-cancellation callback, using the existing async-propagation-disable instrumentation.

Add an exact class-filter exception for TimeoutAccessImpl. The existing TimeoutAccessImpl$* entry covers nested classes, not the enclosing class containing clear().

Motivation

Play 2.6–2.8 smoke diagnostics exposed unresolved continuations captured by this cleanup callback. It waits on request-entity completion, which can remain unresolved even after the response completes.

This callback only cancels a timer; it does not need request context. Actual timeout handlers and normal request propagation remain unchanged.

flowchart LR
    A[Response completes] --> B[TimeoutAccessImpl.clear]
    B --> C[Register cancellation callback]
    C --> D[Wait for entity completion]
    D --> E[Cancel timeout task]
    B -. Previously captured request context .-> F[Unresolved continuation]
    style F fill:#f8d7da,stroke:#dc3545
    style C fill:#d4edda,stroke:#28a745
Loading

Here we remove the unwanted context capture without changing cancellation behavior.

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@amarziali
amarziali requested review from a team as code owners September 23, 2026 15:31
@amarziali
amarziali requested review from bric3 and removed request for a team September 23, 2026 15:31
@amarziali amarziali added type: bug fix Bug fix inst: akka Akka instrumentation tag: ai generated Largely based on code generated by an AI or LLM tag: override groovy enforcement Override the "Enforce Groovy Migration" check labels Sep 23, 2026
@amarziali
amarziali requested review from ValentinZakharov and removed request for a team September 23, 2026 15:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 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-23T15:39:44.791397Z 642f7bd PR opened
🔒 Security Review ✅ Completed 2026-09-23T15:37:10.138881Z 642f7bd PR opened
ℹ️ 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.

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 59.28% (-0.03%)

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

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 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.

⚠️ Autotest was unable to complete this review. View session

Please try again by commenting @autotest review.

@dd-octo-sts

dd-octo-sts Bot commented Sep 23, 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.00 s 13.89 s [+0.0%; +1.5%] (maybe worse)
startup:insecure-bank:tracing:Agent 12.99 s 13.02 s [-1.0%; +0.5%] (no difference)
startup:petclinic:appsec:Agent 17.63 s 16.81 s [+0.6%; +9.2%] (maybe worse)
startup:petclinic:iast:Agent 16.84 s 17.56 s [-8.2%; -0.0%] (maybe better)
startup:petclinic:profiling:Agent 17.24 s 17.32 s [-1.5%; +0.6%] (no difference)
startup:petclinic:sca:Agent 17.60 s 17.51 s [-0.5%; +1.6%] (no difference)
startup:petclinic:tracing:Agent 16.25 s 16.31 s [-6.3%; +5.5%] (unstable)

Commit: 642f7bda · 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.

@amarziali
amarziali enabled auto-merge September 25, 2026 08:15
@amarziali amarziali added tag: override groovy enforcement Override the "Enforce Groovy Migration" check and removed tag: override groovy enforcement Override the "Enforce Groovy Migration" check labels Sep 25, 2026
@amarziali
amarziali added this pull request to the merge queue Sep 25, 2026
@dd-octo-sts

dd-octo-sts Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-09-25 13:36:58 UTC ℹ️ Start processing command /merge


2026-09-25 13:37:03 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-09-25 14:53:22 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 25, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit e5e58b6 into master Sep 25, 2026
618 of 623 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the andrea.marziali/akka-http-timeout-cleanup-context branch September 25, 2026 14:53
@github-actions github-actions Bot added this to the 1.67.0 milestone Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: akka Akka instrumentation tag: ai generated Largely based on code generated by an AI or LLM tag: override groovy enforcement Override the "Enforce Groovy Migration" check type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants