GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Make public API specify explicit maxAllocation to prevent OOM (#15005) by normanmaurer · Pull Request #15122 · netty/netty Conversation
Member
Motivation: The current Modification:
Result: This change does not modify the public API behavior, but it encourages users to adopt the updated methods, which include the explicit Fixes #6663.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsMotivation: The current `ZLibCodecFactory` provides `newZlibDecoder` methods without an option to specify a maximum memory limit for decompression. These methods are utilized in various parts of the project, such as the per-message WebSocket extension. As a result, a client could send a small, maliciously crafted compressed message that, upon decompression, would consume all available memory. This can lead to an `OutOfMemoryError` scenario, which can easily be reproduced as follows: ``` Exception in thread "io-compute-15" java.lang.OutOfMemoryError: Java heap space at io.netty.util.internal.PlatformDependent.allocateUninitializedArray(PlatformDependent.java:326) at io.netty.buffer.PoolArena$HeapArena.newByteArray(PoolArena.java:628) at io.netty.buffer.PoolArena$HeapArena.newUnpooledChunk(PoolArena.java:652) at io.netty.buffer.PoolArena.allocateHuge(PoolArena.java:224) at io.netty.buffer.PoolArena.allocate(PoolArena.java:142) at io.netty.buffer.PoolArena.reallocate(PoolArena.java:317) at io.netty.buffer.PooledByteBuf.capacity(PooledByteBuf.java:123) at io.netty.buffer.AbstractByteBuf.ensureWritable(AbstractByteBuf.java:333) at io.netty.handler.codec.compression.ZlibDecoder.prepareDecompressBuffer(ZlibDecoder.java:74) at io.netty.handler.codec.compression.JdkZlibDecoder.decode(JdkZlibDecoder.java:265) at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:530) at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:469) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1357) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:868) at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:348) at io.netty.handler.codec.http.websocketx.extensions.compression.DeflateDecoder.decompressContent(DeflateDecoder.java:119) at io.netty.handler.codec.http.websocketx.extensions.compression.DeflateDecoder.decode(DeflateDecoder.java:80) at io.netty.handler.codec.http.websocketx.extensions.compression.PerMessageDeflateDecoder.decode(PerMessageDeflateDecoder.java:87) at io.netty.handler.codec.http.websocketx.extensions.compression.PerMessageDeflateDecoder.decode(PerMessageDeflateDecoder.java:31) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:91) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:289) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) java.lang.OutOfMemoryError: Java heap space at io.netty.util.internal.PlatformDependent.allocateUninitializedArray(PlatformDependent.java:326) at io.netty.buffer.PoolArena$HeapArena.newByteArray(PoolArena.java:628) at io.netty.buffer.PoolArena$HeapArena.newUnpooledChunk(PoolArena.java:652) ``` Modification: - Introduced new `newZlibDecoder` methods within `ZlibCodecFactory` that include an explicit `maxAllocation` parameter to specify the maximum allowed memory during decompression. - The older methods have been deprecated in favor of the new ones. - Public APIs that invoke `newZlibDecoder` now require the `maxAllocation` parameter as well. Result: This change does not modify the public API behavior, but it encourages users to adopt the updated methods, which include the explicit `maxAllocation` argument, providing more control over memory usage during decompression. Fixes #6663.
violetagg
added a commit
to reactor/reactor-netty
that referenced
this pull request
Related to netty/netty#15122 Signed-off-by: Violeta Georgieva <[email protected]>
violetagg
added a commit
to reactor/reactor-netty
that referenced
this pull request
Related to netty/netty#15122 Signed-off-by: Violeta Georgieva <[email protected]>
LuciferYang
pushed a commit
to apache/spark
that referenced
this pull request
…e to 2.0.72.Final ### What changes were proposed in this pull request? This PR aims to Upgrade Netty to 4.1.122.Final and Netty-tcnative to 2.0.72.Final. ### Why are the changes needed? To bring the Java 24 related update and the latest bug fixes. > We decided to enable sun.misc.Unsafe by default again when using JDK24+ (when possible) as disabling it by default on this java versions did come with quite a performance regression. - https://netty.io/news/2025/06/03/4-1-122-Final.html - netty/netty#15296 - netty/netty#15248 - netty/netty#15122 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #51145 from dongjoon-hyun/SPARK-52438. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: yangjie01 <[email protected]>
violetagg
added a commit
to reactor/reactor-netty
that referenced
this pull request
Related to netty/netty#15122 Signed-off-by: Violeta Georgieva <[email protected]>
violetagg
added a commit
to reactor/reactor-netty
that referenced
this pull request
Related to netty/netty#15122 Signed-off-by: Violeta Georgieva <[email protected]>
prabhjyotsingh
pushed a commit
to acceldata-io/spark3
that referenced
this pull request
…e to 2.0.72.Final This PR aims to Upgrade Netty to 4.1.122.Final and Netty-tcnative to 2.0.72.Final. To bring the Java 24 related update and the latest bug fixes. > We decided to enable sun.misc.Unsafe by default again when using JDK24+ (when possible) as disabling it by default on this java versions did come with quite a performance regression. - https://netty.io/news/2025/06/03/4-1-122-Final.html - netty/netty#15296 - netty/netty#15248 - netty/netty#15122 No. Pass the CIs. No. Closes apache#51145 from dongjoon-hyun/SPARK-52438. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: yangjie01 <[email protected]>
prabhjyotsingh
pushed a commit
to acceldata-io/spark3
that referenced
this pull request
…e to 2.0.72.Final This PR aims to Upgrade Netty to 4.1.122.Final and Netty-tcnative to 2.0.72.Final. To bring the Java 24 related update and the latest bug fixes. > We decided to enable sun.misc.Unsafe by default again when using JDK24+ (when possible) as disabling it by default on this java versions did come with quite a performance regression. - https://netty.io/news/2025/06/03/4-1-122-Final.html - netty/netty#15296 - netty/netty#15248 - netty/netty#15122 No. Pass the CIs. No. Closes apache#51145 from dongjoon-hyun/SPARK-52438. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: yangjie01 <[email protected]>
prabhjyotsingh
pushed a commit
to acceldata-io/spark3
that referenced
this pull request
…e to 2.0.72.Final This PR aims to Upgrade Netty to 4.1.122.Final and Netty-tcnative to 2.0.72.Final. To bring the Java 24 related update and the latest bug fixes. > We decided to enable sun.misc.Unsafe by default again when using JDK24+ (when possible) as disabling it by default on this java versions did come with quite a performance regression. - https://netty.io/news/2025/06/03/4-1-122-Final.html - netty/netty#15296 - netty/netty#15248 - netty/netty#15122 No. Pass the CIs. No. Closes apache#51145 from dongjoon-hyun/SPARK-52438. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: yangjie01 <[email protected]>
Ko-dany
pushed a commit
to acceldata-io/spark3
that referenced
this pull request
…e to 2.0.72.Final This PR aims to Upgrade Netty to 4.1.122.Final and Netty-tcnative to 2.0.72.Final. To bring the Java 24 related update and the latest bug fixes. > We decided to enable sun.misc.Unsafe by default again when using JDK24+ (when possible) as disabling it by default on this java versions did come with quite a performance regression. - https://netty.io/news/2025/06/03/4-1-122-Final.html - netty/netty#15296 - netty/netty#15248 - netty/netty#15122 No. Pass the CIs. No. Closes apache#51145 from dongjoon-hyun/SPARK-52438. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: yangjie01 <[email protected]>
This was referenced
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |