Skip to content

Fix Java TLS support bugs, exposed by Kafka TLS#1380

Merged
grcevski merged 3 commits into
open-telemetry:mainfrom
grcevski:fix_kafka_java_tls
Feb 27, 2026
Merged

Fix Java TLS support bugs, exposed by Kafka TLS#1380
grcevski merged 3 commits into
open-telemetry:mainfrom
grcevski:fix_kafka_java_tls

Conversation

@grcevski
Copy link
Copy Markdown
Contributor

There were couple of issues here:

  1. ReadAdvice was saying it was associating the connection with SSL, but the call to SSLStorage.setConnectionForBuf(bufKey, c); was missing 🤦
  2. I had put an optimisation to see if the connection was already associated, but this is wrong, for persistent long lived connections, so I removed the check, now we associate the connection to all buffers.
  3. Finally, the matching of the encrypted and unencrypted buffers on the unwrap side of the SSLEngine was done at the wrong place. With TLS 1.3 the decoding can change the original source buffer in place, so the correlation code wasn't working. I fixed this by extracting the key in the Entry method, rather than in the Exit method.

@grcevski grcevski requested a review from a team as a code owner February 27, 2026 17:57
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.75%. Comparing base (55f2804) to head (b63d733).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
internal/test/integration/red_test_kafka.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1380   +/-   ##
=======================================
  Coverage   43.75%   43.75%           
=======================================
  Files         310      310           
  Lines       33772    33771    -1     
=======================================
  Hits        14777    14777           
+ Misses      18044    18043    -1     
  Partials      951      951           
Flag Coverage Δ
integration-test 21.59% <ø> (ø)
integration-test-arm 0.00% <ø> (ø)
integration-test-vm-x86_64-5.15.152 0.00% <ø> (ø)
integration-test-vm-x86_64-6.10.6 0.00% <ø> (ø)
k8s-integration-test 2.32% <ø> (+<0.01%) ⬆️
oats-test 0.00% <ø> (ø)
unittests 44.64% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@rafaelroquetto rafaelroquetto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the nostalgia of reviewing Java code! LGTM!

@grcevski grcevski merged commit 0c1a6af into open-telemetry:main Feb 27, 2026
69 checks passed
@grcevski grcevski deleted the fix_kafka_java_tls branch February 27, 2026 20:23
NimrodAvni78 pushed a commit to coralogix/opentelemetry-ebpf-instrumentation that referenced this pull request Mar 1, 2026
@MrAlias MrAlias added this to the v0.6.0 milestone Mar 2, 2026
@MrAlias MrAlias mentioned this pull request Mar 5, 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.

3 participants