[Poll] Shading Netty
See original GitHub issueRelated issues:
- #705 Shade Netty to simplify dependency conflicts against other systems
- #988 (wip) Shaded Netty
- #1009 Expose netty channel option to end-user
We must decide to shade Netty or not in our shaded JARs.
Why? Because we cannot shade Netty as long as we expose Netty classes in our public API.
Why? Because otherwise our public API will be different between our shaded JARs and unshaded JARs.
Therefore, if we decide to shade Netty in our shaded JARs, we must hide all references to Netty classes from our public API. This will involve some breaking changes such as:
- Provide some abstraction layer for core Netty classes such as
EventLoop
andChannelOption
- Fork other Netty classes we expose in our public API, such as:
AsciiString
- affectsHttpHeaders
a lotAttributeMap
- affectsRequestContext.attrs()
Headers
- affectsHttpHeaders
a lot, becauseHttpHeaders
extendsHeaders
ByteBuf
- affectsByteBufHttpData
- Make sure tcnative and epoll works even after shading.
Some may argue that such a large change can’t be justified, given that Netty 4.1 has been fairly stable recently and 4.0 reached at its end of life.
In my opinion, there are three options for this matter:
- Shade Netty completely.
- This is the most safe option, but requires all the changes mentioned above.
- Do not shade
netty-common
,netty-buffer
,netty-transport-*
andnetty-codec
. Shade other Netty dependencies such asnetty-codec-http
,netty-codec-http2
andnetty-resolver-*
- This will still break if mixed with something that depends on Netty 4.0.
- This will still break if Netty makes a breaking change in unshaded Netty dependencies in 4.1, although I believe it is not very likely.
- Breaking changes in Armeria will be kept minimal, because we can still refer to
AsciiString
,AttributeMap
,ByteBuf
,EventLoop
,ChannelOption
andHeader
.
- Do not shade Netty at all.
- This may also be fine. A user could just shade Netty when building his or her distribution.
Please feel free to ask questions or discuss about the pros and cons of each choice. Please add the following reactions to this issue to cast a vote:
- 😄 for (1) Shade Netty completely.
- 🎉 for (2) Shade Netty partially. We will discuss later again about which Netty artifact should be and should not be shaded.
- ❤️ for (3) Do not shade Netty at all.
This poll will be open for about a week.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:16
- Comments:8
Top GitHub Comments
@rkapsi We can expose all Netty channel options via some abstraction layer even if we shaded Netty, so no worries 😃
Closing the poll:
Let us not shade Netty.