Skip to content

Release Akka message continuations when discarded to dead letters - #12616

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
masterfrom
andrea.marziali/akka-dead-letter-cleanup
Sep 29, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
masterfrom
andrea.marziali/akka-dead-letter-cleanup

Conversation

@amarziali

Copy link
Copy Markdown
Contributor

What Does This Do

Release the captured continuation when Akka’s dead-letter queue discards a message envelope.

An actor can terminate while traced messages remain in its mailbox. Akka drains those messages into the dead-letter queue, bypassing ActorCell.invoke() and its normal continuation cleanup.

Changes

  • Release the envelope’s continuation after dead-letter handling, including exceptional exits.
  • Match MessageQueue implementations nested inside Mailboxes, avoiding reliance on Scala’s anonymous-class numbering.
  • Preserve normal actor-message propagation.
  • Add deterministic tests for single, multiple and already-wrapped dead-letter messages discarded during termination.
flowchart LR
  A[Capture context in message envelope] --> B{Message disposition}
  B -->|Delivered| C[Actor invokes and closes context]
  B -->|Actor terminates| D[Dead-letter queue]
  D -->|Previously| E[Continuation remains unresolved]
  D -->|Fixed| F[Release captured continuation]
  linkStyle 1,4 stroke:green
  linkStyle 3 stroke:red
Loading

Motivation

This surfaced in the Play 2.5 smoke tests: stream subscription notifications were discarded after their actor stopped, leaving request continuations unresolved.

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@amarziali
amarziali requested a review from a team as a code owner September 23, 2026 15:57
@amarziali amarziali added the type: bug fix Bug fix label Sep 23, 2026
@amarziali
amarziali removed the request for review from a team September 23, 2026 15:57
@amarziali amarziali added the inst: akka Akka instrumentation label Sep 23, 2026
@amarziali amarziali added the tag: ai generated Largely based on code generated by an AI or LLM label Sep 23, 2026
@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-23T16:00:59.910718Z ac09499 PR opened
🔒 Security Review ✅ Completed 2026-09-23T16:03:49.296771Z ac09499 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.

@amarziali
amarziali requested a review from mcculls September 23, 2026 15:58
@amarziali amarziali added the tag: override groovy enforcement Override the "Enforce Groovy Migration" check label Sep 23, 2026
@datadog-datadog-us1-prod

This comment has been minimized.

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

⚠️ 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.99 s [-0.6%; +0.7%] (no difference)
startup:insecure-bank:tracing:Agent 12.96 s 13.06 s [-1.8%; +0.2%] (no difference)
startup:petclinic:appsec:Agent 17.55 s 17.49 s [-0.4%; +1.0%] (no difference)
startup:petclinic:iast:Agent 17.44 s 17.61 s [-1.8%; -0.1%] (maybe better)
startup:petclinic:profiling:Agent 17.43 s 16.71 s [-0.5%; +9.1%] (no difference)
startup:petclinic:sca:Agent 17.59 s 17.28 s [+0.9%; +2.7%] (maybe worse)
startup:petclinic:tracing:Agent 16.50 s 16.67 s [-2.0%; -0.0%] (maybe better)

Commit: 72908d8d · 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

Copy link
Copy Markdown
Contributor Author

/code blockers

@gh-worker-devflow-routing-ef8351

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

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-09-28 07:35:19 UTC ℹ️ Start processing command /code blockers


2026-09-28 07:35:19 UTC ℹ️ Devflow:

Checking merge blockers for #12616...


2026-09-28 07:35:28 UTC ℹ️ Devflow: /code blockers

Detected 1 merge blocker(s) to address:

🟠 Pending

  • Merge gate rule reviewers-approval is running: 1 approval missing
    All required reviewers must approve this pull request before it can be merged. Learn more in our FAQ.

    • Needs approval from Team: apm-idm-java

    Hint: Questions about this check? Reach out in #dx-source-code-management on Slack.

@amarziali

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

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

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-09-28 15:57:38 UTC ℹ️ Start processing command /merge


2026-09-28 15:57:42 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-09-28 16:11:23 UTC ❌ MergeQueue: The build pipeline contains failing jobs for this merge request

Build pipeline has failing jobs for 40ad441:

⚠️ Do NOT retry failed jobs directly (why?).

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • If your PR checks are green, try to rebase/merge. It might be because the CI run is a bit old.
  • Any question, go check the FAQ.
Details

Since those jobs are not marked as being allowed to fail, the pipeline will most likely fail.
Therefore, and to allow other builds to be processed, this merge request has been rejected and the pipeline got canceled.

@amarziali

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

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

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-09-29 06:51:35 UTC ℹ️ Start processing command /merge


2026-09-29 06:51:40 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-09-29 08:05:18 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 3901ee2 into master Sep 29, 2026
605 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the andrea.marziali/akka-dead-letter-cleanup branch September 29, 2026 08:05
@github-actions github-actions Bot added this to the 1.67.0 milestone Sep 29, 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