Skip to content

Fine tune async propagation for lettuce 5#11607

Open
amarziali wants to merge 5 commits into
masterfrom
andrea.marziali/lettuce-5-async-prop
Open

Fine tune async propagation for lettuce 5#11607
amarziali wants to merge 5 commits into
masterfrom
andrea.marziali/lettuce-5-async-prop

Conversation

@amarziali

@amarziali amarziali commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

This PR blocks async propagations around the connection boundary in lettuce. Previously, the latestDepTest had a strictTraceWrites set to false since continuations were leaked from few tests.

On a failed Redis connection, RedisHandshakeHandler.channelRegistered registers a thenAccept on the handshake future, which is then abandoned.

 handshakeFuture.thenAccept(ignore -> {
            timeoutHandle.cancel();
        });

So the captured continuation is never resolved. Under strict trace writes this discards spans, which is why the Lettuce tests carried a useStrictTraceWrites(false) workaround.

Disabling the async propagation on this little spot prevents this.

Follows the temporal capture events happened in failed tests

gantt
  title Scope continuations (30 total, 1 leaked, 0 late, 0 double)
  dateFormat x
  axisFormat %Lms
  section Test worker
    cap #0 AbstractRedisClient.initializeChannelAsync :milestone, 0, 0
    cap #14 AbstractRedisAsyncCommands.dispatch :milestone, 6, 6
    cap #19 AbstractRedisClient.initializeChannelAsync :milestone, 10, 10
    cap #23 DefaultConnectionFuture.thenApply :milestone, 10, 10
  section lettuce-nioEventLoop-10-1
    cap #9 RedisHandshakeHandler.channelRegistered :milestone, 2, 2
    #9 fin RedisHandshakeHandler.succeed :done, 6, 7
    #14 fin AsyncCommand.completeResult :done, 7, 8
  section lettuce-nioEventLoop-13-1
    #19 fin AbstractRedisClient.lambda$initializeChannelAsync0$6 :done, 12, 13
    #28 LEAK cap RedisHandshakeHandler.channelRegistered :crit, 10, 12
    cap #29 PromiseTask.<init> :milestone, 10, 10
    #29 fin PromiseTask.run :done, 11, 12
Loading

Motivation

Additional Notes

Contributor Checklist

  • Format the title according to the contribution guidelines
  • Assign the type: and (comp: or inst:) labels in addition to any other useful labels
  • Avoid using close, fix, or any linking keywords when referencing an issue
    Use solves instead, and assign the PR milestone to the issue
  • Update the CODEOWNERS file on source file addition, migration, or deletion
  • Update public documentation with any new configuration flags or behaviors
  • Add your completed PR to the merge queue by commenting /merge. You can also:
    • Customize the commit message associated with the merge with /merge --commit-message "..."
    • Remove your PR from the merge queue with /merge -c
    • Skip all merge queue checks with /merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)
    • Get more information in this doc

Jira ticket: [PROJ-IDENT]

@amarziali amarziali added type: bug Bug report and fix inst: lettuce Lettuce instrumentation labels Jun 9, 2026
@datadog-prod-us1-5

This comment has been minimized.

@amarziali amarziali marked this pull request as ready for review June 9, 2026 21:56
@amarziali amarziali requested a review from a team as a code owner June 9, 2026 21:56
@amarziali amarziali requested review from vandonr and removed request for a team June 9, 2026 21:56
chatgpt-codex-connector[bot]

This comment was marked as outdated.

@amarziali

Copy link
Copy Markdown
Contributor Author

@codex review

@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: bfcbd9b949

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

@dd-octo-sts

dd-octo-sts Bot commented Jun 9, 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.74 s 14.61 s [+0.0%; +1.7%] (maybe worse)
startup:insecure-bank:tracing:Agent 13.54 s 13.65 s [-1.4%; -0.2%] (maybe better)
startup:petclinic:appsec:Agent 16.92 s 16.73 s [+0.1%; +2.2%] (maybe worse)
startup:petclinic:iast:Agent 16.88 s 16.92 s [-0.9%; +0.4%] (no difference)
startup:petclinic:profiling:Agent 16.81 s 16.91 s [-1.9%; +0.8%] (no difference)
startup:petclinic:sca:Agent 16.40 s 16.75 s [-6.6%; +2.4%] (no difference)
startup:petclinic:tracing:Agent 16.10 s 16.04 s [-0.9%; +1.6%] (no difference)

Commit: 0e807c1f · 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

@codex review

@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: 09b2c415ad

ℹ️ 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 dd-java-agent/instrumentation/lettuce/lettuce-5.0/build.gradle Outdated
@amarziali

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 21d36aeb34

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

@amarziali amarziali force-pushed the andrea.marziali/lettuce-5-async-prop branch from 21d36ae to 0e807c1 Compare June 12, 2026 10:55
@amarziali amarziali requested a review from a team as a code owner June 12, 2026 10:55
@amarziali amarziali requested review from bric3 and removed request for a team June 12, 2026 10:55
@amarziali

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 0e807c1f9a

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

@amarziali amarziali requested a review from mcculls June 12, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: lettuce Lettuce instrumentation type: bug Bug report and fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants