ZOOKEEPER-4835: Make use of Netty optional when no SSL is used#2374
Open
dsmiley wants to merge 2 commits intoapache:masterfrom
Open
ZOOKEEPER-4835: Make use of Netty optional when no SSL is used#2374dsmiley wants to merge 2 commits intoapache:masterfrom
dsmiley wants to merge 2 commits intoapache:masterfrom
Conversation
… used (#1) * ZOOKEEPER-4835: Make Netty optional when no SSL is used Agent-Logs-Url: https://github.com/dsmiley/zookeeper/sessions/f61cc9b9-0ac8-4f8f-a366-2a7752cdbedc Co-authored-by: dsmiley <377295+dsmiley@users.noreply.github.com> * Address code review: improve error messages and add constants for magic numbers Agent-Logs-Url: https://github.com/dsmiley/zookeeper/sessions/f61cc9b9-0ac8-4f8f-a366-2a7752cdbedc Co-authored-by: dsmiley <377295+dsmiley@users.noreply.github.com> * Remove non-essential log lines; add ArchUnit test to enforce Netty is optional Agent-Logs-Url: https://github.com/dsmiley/zookeeper/sessions/34abe384-a396-4ef6-9ba0-006a7318faa8 Co-authored-by: dsmiley <377295+dsmiley@users.noreply.github.com> * Refine ArchUnit test using dsmiley's approach; fix remaining Netty hard-refs in ZooKeeper/ZooKeeperServer Agent-Logs-Url: https://github.com/dsmiley/zookeeper/sessions/698a4b0f-1e5b-46f8-bf10-f21f9a65a382 Co-authored-by: dsmiley <377295+dsmiley@users.noreply.github.com> * Fix NoClassDefFoundError: split ClientX509Util into Netty-free base and ClientNettyX509Util subclass Agent-Logs-Url: https://github.com/dsmiley/zookeeper/sessions/2dc4e1b6-53f1-4851-91ed-b4427d332564 Co-authored-by: dsmiley <377295+dsmiley@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: dsmiley <377295+dsmiley@users.noreply.github.com>
dsmiley
commented
Apr 20, 2026
Author
dsmiley
left a comment
There was a problem hiding this comment.
All code changes were done by GitHub Copilot Agent, and me going through 3-4 rounds of prompts... plus me showing the ArchUnit test I wrote a few years ago.
Author
There was a problem hiding this comment.
All the code here moved from ClientX509Util
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/ZOOKEEPER-4835
ZOOKEEPER-4835: Make Netty an optional dependency when SSL is not used
Netty is now declared as
<optional>true</optional>in zookeeper-server/pom.xml,so embedders who do not need SSL/TLS no longer pull in Netty transitively.
The zookeeper-assembly distribution still includes Netty for full SSL support.
Key changes:
ClientX509Utilinto a Netty-free base class andClientNettyX509Utilsubclass,so the common X509/SSL abstraction compiles without Netty on the classpath.
ZooKeeper,ZooKeeperServer, and startup classes;Netty factory/util classes are now loaded reflectively or guarded by classpath checks.
NettyOptionalArchTest) to enforce that core classes neveracquire a hard compile-time dependency on Netty.
I tested that Solr's tests pass when changing it to use a local snapshot of ZK with these changes. Solr's tests embed ZK server, and also are a client to ZK.