Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Snappy compression failures #257

Merged
merged 1 commit into from
Nov 13, 2018
Merged

Snappy compression failures #257

merged 1 commit into from
Nov 13, 2018

Conversation

shemnon
Copy link
Contributor

@shemnon shemnon commented Nov 13, 2018

PR description

Possible fix for #251 - swap out a JNI based library for an all-Java library

Fixed Issue(s)

#251

Replace the JNI based snappy library with an all Java version.
@ajsutton
Copy link
Contributor

Well, we did get better error messages:

2018-11-14 07:27:12.068+10:00 | nioEventLoopGroup-3-1 | ERROR | DeFramer | Exception while processing incoming message
io.netty.handler.codec.DecoderException: org.iq80.snappy.CorruptionException: Recorded length is 1473 bytes but actual length after decompression is 0 bytes
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:459) ~[netty-codec-4.1.15.Final.jar:4.1.15.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265) ~[netty-codec-4.1.15.Final.jar:4.1.15.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.15.Final.jar:4.1.15.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.15.Final.jar:4.1.15.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.15.Final.jar:4.1.15.Final]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359) [netty-transport-4.1.15.Final.jar:4.1.15.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.15.Final.jar:4.1.15.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.15.Final.jar:4.1.15.Final]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935) [netty-transport-4.1.15.Final.jar:4.1.15.Final]
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134) [netty-transport-4.1.15.Final.jar:4.1.15.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645) [netty-transport-4.1.15.Final.jar:4.1.15.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580) [netty-transport-4.1.15.Final.jar:4.1.15.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497) [netty-transport-4.1.15.Final.jar:4.1.15.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459) [netty-transport-4.1.15.Final.jar:4.1.15.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [netty-common-4.1.15.Final.jar:4.1.15.Final]
        at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138) [netty-common-4.1.15.Final.jar:4.1.15.Final]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
Caused by: org.iq80.snappy.CorruptionException: Recorded length is 1473 bytes but actual length after decompression is 0 bytes
        at org.iq80.snappy.SnappyDecompressor.uncompress(SnappyDecompressor.java:55) ~[snappy-0.4.jar:?]
        at org.iq80.snappy.Snappy.uncompress(Snappy.java:85) ~[snappy-0.4.jar:?]
        at tech.pegasys.pantheon.ethereum.p2p.rlpx.framing.SnappyCompressor.decompress(SnappyCompressor.java:35) ~[pantheon-p2p-0.9.0-SNAPSHOT.jar:0.9.0-SNAPSHOT]
        at tech.pegasys.pantheon.ethereum.p2p.rlpx.framing.Framer.processFrame(Framer.java:265) ~[pantheon-p2p-0.9.0-SNAPSHOT.jar:0.9.0-SNAPSHOT]
        at tech.pegasys.pantheon.ethereum.p2p.rlpx.framing.Framer.deframe(Framer.java:156) ~[pantheon-p2p-0.9.0-SNAPSHOT.jar:0.9.0-SNAPSHOT]
        at tech.pegasys.pantheon.ethereum.p2p.netty.DeFramer.decode(DeFramer.java:67) ~[pantheon-p2p-0.9.0-SNAPSHOT.jar:0.9.0-SNAPSHOT]
        at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489) ~[netty-codec-4.1.15.Final.jar:4.1.15.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428) ~[netty-codec-4.1.15.Final.jar:4.1.15.Final]
        ... 16 more

Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Won't fix the issue but less JNI and better error messages is definitely worth while.

@shemnon shemnon merged commit 4a75fb7 into PegaSysEng:master Nov 13, 2018
@shemnon shemnon deleted the goerli branch November 13, 2018 21:51
shemnon added a commit to shemnon/pantheon that referenced this pull request Nov 14, 2018
Replace the JNI based snappy library with an all Java version.  
This will help work on #251 because the error messages are more reasonable
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants