Skip to content

Introduce new libs/netty4 module to share common implementation between netty-based plugins and modules (transport-netty4, transport-reactor-netty4)#20447

Merged
reta merged 1 commit intoopensearch-project:mainfrom
reta:poc.libs.netty
Jan 22, 2026
Merged

Introduce new libs/netty4 module to share common implementation between netty-based plugins and modules (transport-netty4, transport-reactor-netty4)#20447
reta merged 1 commit intoopensearch-project:mainfrom
reta:poc.libs.netty

Conversation

@reta
Copy link
Copy Markdown
Contributor

@reta reta commented Jan 21, 2026

Description

Introduce new libs/netty module to share common implementation between netty-based plugins and modules (transport-netty4, transport-reactor-netty)

Related Issues

Followup on #20434 (comment)

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@reta reta requested review from a team and peternied as code owners January 21, 2026 02:45
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 21, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

A new shared Netty library module (libs/netty) is introduced containing HTTP/3 QUIC token handling. The SecureQuicTokenHandler class is moved from reactor-netty4 plugin to this library and refactored to accept a dependency-injected SecureRandom. Transport modules are updated to depend on and use this new library. The Http3Utils utility class is removed.

Changes

Cohort / File(s) Summary
New Netty Library Module - Build & Configuration
libs/netty/build.gradle
Gradle build script with opensearch.publish plugin, Netty dependencies (handler, buffer, common, codec-classes-quic), API dependency on opensearch-common, extensive thirdPartyAudit ignore rules for Netty and related ecosystems, and forbiddenApisMain customization.
New Netty Library Module - Licensing
libs/netty/licenses/netty-LICENSE.txt, libs/netty/licenses/netty-NOTICE.txt
Standard Apache 2.0 license text and aggregated NOTICE file documenting Netty and optional dependency licenses (JSR-166Y, Base64, JZlib, Webbit, Protocol Buffers, Bouncy Castle, SLF4J, Log4J, etc.).
New Netty Library Module - Artifact Checksums
libs/netty/licenses/netty-*.jar.sha1
SHA-1 checksums for four Netty 4.2.9.Final JAR artifacts: buffer, codec-classes-quic, common, and handler.
HTTP/3 QUIC Token Handler - Moved & Refactored
libs/netty/src/main/java/org/opensearch/http/netty4/http3/SecureQuicTokenHandler.java
Moved from reactor-netty4 plugin; constructor changed from no-arg to accepting SecureRandom random parameter; internal RNG usage replaced with injected dependency; package namespace updated to org.opensearch.http.netty4.http3.
HTTP/3 QUIC Token Handler - Package Declaration
libs/netty/src/main/java/org/opensearch/http/netty4/http3/package-info.java
Package declaration corrected from org.opensearch.http.reactor.netty4.http3 to org.opensearch.http.netty4.http3.
Module Dependency Updates
modules/transport-netty4/build.gradle, plugins/transport-reactor-netty4/build.gradle
Both modules now declare public API dependency on :libs:opensearch-netty to expose the shared Netty library.
Transport Implementation Updates
modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4Http3ServerTransport.java, plugins/transport-reactor-netty4/src/main/java/org/opensearch/http/reactor/netty4/ReactorNetty4HttpServerTransport.java
Both updated to instantiate SecureQuicTokenHandler with Randomness.createSecure() for dependency injection; imports adjusted to reference new package location.
Test Updates
plugins/transport-reactor-netty4/src/test/java/org/opensearch/http/reactor/netty4/ReactorHttpClient.java
Import path for Http3Utils updated to reference new location (though class is being removed).
Removed Utility Classes
plugins/transport-reactor-netty4/src/main/java/org/opensearch/http/reactor/netty4/http3/Http3Utils.java, plugins/transport-reactor-netty4/src/main/java/org/opensearch/http/reactor/netty4/http3/SecureQuicTokenHandler.java
Http3Utils (runtime HTTP/3 availability detection) deleted entirely; original SecureQuicTokenHandler removed from reactor-netty4 plugin as it is now in the shared libs-netty module.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

enhancement, distributed framework

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description includes the required sections: a clear description of the change, a reference to the related issue (#20434), and the standard Apache 2.0 license confirmation.
Title check ✅ Passed The title accurately describes the main change: introducing a new libs/netty module to share common implementation between netty-based plugins and modules. It is specific, concise, and clearly summarizes the primary objective of the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@reta
Copy link
Copy Markdown
Contributor Author

reta commented Jan 21, 2026

@cwperks it looks like quite a few things could be shared but realistically - not that many because of dependencies on server module from many seemingly innocent classes .

@github-actions
Copy link
Copy Markdown
Contributor

✅ Gradle check result for 38c474f: SUCCESS

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.33%. Comparing base (af61c36) to head (3f9bcbc).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #20447      +/-   ##
============================================
+ Coverage     73.24%   73.33%   +0.08%     
- Complexity    71961    72016      +55     
============================================
  Files          5795     5795              
  Lines        329185   329248      +63     
  Branches      47403    47410       +7     
============================================
+ Hits         241125   241446     +321     
+ Misses        68734    68406     -328     
- Partials      19326    19396      +70     

☔ 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.

@reta reta changed the title Introduce new libs/netty module to share common implementation between netty-based plugins and modules (transport-netty4, transport-reactor-netty4) Introduce new libs/netty4 module to share common implementation between netty-based plugins and modules (transport-netty4, transport-reactor-netty4) Jan 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

❌ Gradle check result for abc57fd: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

…en netty-based plugins and modules (transport-netty4, transport-reactor-netty4)

Signed-off-by: Andriy Redko <drreta@gmail.com>
@reta
Copy link
Copy Markdown
Contributor Author

reta commented Jan 22, 2026

@cwperks if you have a second, moved a few more classes and renamed the module from netty to netty4 (in case we will have netty5 at some point), thank you.

@github-actions
Copy link
Copy Markdown
Contributor

✅ Gradle check result for 3f9bcbc: SUCCESS

@reta reta merged commit 967c809 into opensearch-project:main Jan 22, 2026
34 checks passed
tanyabti pushed a commit to tanyabti/OpenSearch that referenced this pull request Feb 24, 2026
…en netty-based plugins and modules (transport-netty4, transport-reactor-netty4) (opensearch-project#20447)

Signed-off-by: Andriy Redko <drreta@gmail.com>
tanyabti pushed a commit to tanyabti/OpenSearch that referenced this pull request Feb 24, 2026
…en netty-based plugins and modules (transport-netty4, transport-reactor-netty4) (opensearch-project#20447)

Signed-off-by: Andriy Redko <drreta@gmail.com>
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.

2 participants