Skip to content

feat(natsock): patch Netty's native epoll transport library by symbol - #730

Draft
kaahos wants to merge 40 commits into
paul.fournillon/taskblock-native-iofrom
paul.fournillon/native_socket_netty
Draft

feat(natsock): patch Netty's native epoll transport library by symbol#730
kaahos wants to merge 40 commits into
paul.fournillon/taskblock-native-iofrom
paul.fournillon/native_socket_netty

Conversation

@kaahos

@kaahos kaahos commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?:

Extends native socket patching to detect Netty's native epoll transport library (libnetty_transport_native_epoll*.so) by exported symbol, so it can be patched even when it lives outside the JDK's lib directory and its filename is relocated under shading (e.g. grpc-netty-shaded).

Motivation:

Netty's native epoll transport bypasses the JDK's socket path, so socket-related events were missed for applications using it.

Additional Notes:

Detection matches on JNI_OnLoad_netty_transport_native_epoll / JNI_OnUnload_netty_transport_native_epoll symbol pairs rather than basename, mirroring the existing IBM JCL bridge all-or-nothing check.

How to test the change?:

New unit tests in nativeSocketInterposer_ut.cpp cover plain and shaded Netty native epoll libraries, plus rejection when only one of the two symbols is present.

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a security review (run the dd:platform-security-review
    skill, or file a request via the PSEC review form).
    bewaire also runs automatically on every PR.
  • This PR doesn't touch any of that.
  • JIRA: [JIRA-XXXX]

Unsure? Have a question? Request a review!

@dd-octo-sts

dd-octo-sts Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #32118507342 | Commit: 62fcbf4 | Duration: 0s (longest job)

All 0 test jobs passed

Summary: Total: 0 | Passed: 0 | Failed: 0


Updated: 2026-08-18 22:33:28 UTC

@kaahos
kaahos force-pushed the paul.fournillon/native_socket_netty branch from 9de97d6 to ddd6385 Compare August 16, 2026 14:26
@datadog-official

datadog-official Bot commented Aug 16, 2026

Copy link
Copy Markdown

Tests

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 54c2392 | Docs | View more details | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Scan-Build Report

User:runner@runnervmzvulz
Working Directory:/home/runner/work/java-profiler/java-profiler/ddprof-lib/src/test/make
Command Line:make -j4 all
Clang Version:Ubuntu clang version 18.1.3 (1ubuntu1)
Date:Tue Aug 18 08:53:05 2026

Bug Summary

Bug TypeQuantityDisplay?
All Bugs1
Logic error
Dereference of null pointer1

Reports

Bug Group Bug Type ▾ File Function/Method Line Path Length
Logic errorDereference of null pointerprofiler.hfindLibraryByAddress62828

@kaahos
kaahos force-pushed the paul.fournillon/native_socket_netty branch from ddd6385 to cdf93b0 Compare August 16, 2026 15:00
@dd-octo-sts

dd-octo-sts Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

All 40 integration tests passed

📊 Dashboard · 👷 Pipeline · 📦 54c23928

@kaahos
kaahos force-pushed the paul.fournillon/native_socket_netty branch from cdf93b0 to 003c443 Compare August 16, 2026 18:24
@kaahos
kaahos force-pushed the paul.fournillon/native_socket_netty branch from 003c443 to 1347a00 Compare August 17, 2026 12:38
kaahos added 23 commits August 18, 2026 10:51
parkEnter/parkEnter0 had regressed from boolean to void during an
earlier rebase conflict resolution, only merging in the new Thread
parameter and silently dropping the "owns a park interval" contract
enforced by JavaProfilerApiSurfaceTest.
These files still referenced JMC's IItemCollection after the rebase
onto the jafar-migrated taskblock-jvm-producers stack; verifyEvents()
now returns JfrEvents.
@kaahos
kaahos force-pushed the paul.fournillon/native_socket_netty branch from 1347a00 to 54c2392 Compare August 18, 2026 08:51
@dd-octo-sts

dd-octo-sts Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Reliability & Chaos Results

All reliability & chaos checks passed Pipeline: https://gitlab.ddbuild.io/DataDog/java-profiler/-/pipelines/131524054

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant