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

Check if the connectFuture has completed successfully #293

Merged
merged 2 commits into from
Nov 22, 2018

Conversation

ajsutton
Copy link
Contributor

PR description

When a connection is disconnected because it has no shared capabilities and we receive un uncompressed DISCONNECT message from the client, DeFramer incorrectly believes it still needs to disconnect the peer because it checked if the future had completed, but not if it had completed successfully.

Resulting exception:

Nov 21, 2018 12:39:44 PM io.netty.channel.AbstractChannelHandlerContext invokeExceptionCaught
WARNING: An exception 'java.util.concurrent.ExecutionException: tech.pegasys.pantheon.ethereum.p2p.netty.exceptions.IncompatiblePeerException: No shared capabilities' [enable DEBUG level for full stacktrace] was thrown by a user handler's exceptionCaught() method while ha
ndling the following exception:
io.netty.handler.codec.DecoderException: tech.pegasys.pantheon.ethereum.p2p.rlpx.framing.FramingException: Decompression failed
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:459)
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
        at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
        at java.lang.Thread.run(Thread.java:748)
Caused by: tech.pegasys.pantheon.ethereum.p2p.rlpx.framing.FramingException: Decompression failed
        at tech.pegasys.pantheon.ethereum.p2p.rlpx.framing.Framer.processFrame(Framer.java:267)
        at tech.pegasys.pantheon.ethereum.p2p.rlpx.framing.Framer.deframe(Framer.java:155)
        at tech.pegasys.pantheon.ethereum.p2p.netty.DeFramer.decode(DeFramer.java:69)
        at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)
        ... 16 more
Caused by: org.iq80.snappy.CorruptionException: Recorded length is 449 bytes but actual length after decompression is 0 bytes
        at org.iq80.snappy.SnappyDecompressor.uncompress(SnappyDecompressor.java:55)
        at org.iq80.snappy.Snappy.uncompress(Snappy.java:85)
        at tech.pegasys.pantheon.ethereum.p2p.rlpx.framing.SnappyCompressor.decompress(SnappyCompressor.java:33)
        at tech.pegasys.pantheon.ethereum.p2p.rlpx.framing.Framer.processFrame(Framer.java:264)
        ... 20 more

@ajsutton ajsutton added the bug Something isn't working label Nov 22, 2018
@ajsutton ajsutton merged commit 448e465 into PegaSysEng:master Nov 22, 2018
@ajsutton ajsutton deleted the check-complete branch November 22, 2018 21:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants