Random disconnects on websocket
See original GitHub issueOur app is using Vertx 3.5.0 with netty 4.0.15. Often, we see websockets disconnect randomly. There were no exceptions thrown at the time of disconnect, but we see a consistent pattern in how it happens. I enabled debug logging on one of the servers and were able to capture the events during disconnect.
Here is a sequence:
2018-04-13 13:58:31.701 | DEBUG | LoggingHandler | vert.x-eventloop-thread-3 | [id: 0x6b76bf39, L:/<Server>:51382 - R:<Remote>:443] READ: 1357B 2018-04-13 13:58:31.701 | DEBUG | WebSocket08FrameDecoder | vert.x-eventloop-thread-3 | Decoding WebSocket Frame opCode=1 2018-04-13 13:58:31.701 | DEBUG | WebSocket08FrameDecoder | vert.x-eventloop-thread-3 | Decoding WebSocket Frame length=1019 2018-04-13 13:58:31.701 | DEBUG | WebSocket08FrameDecoder | vert.x-eventloop-thread-3 | Decoding WebSocket Frame opCode=0 2018-04-13 13:58:31.701 | DEBUG | WebSocket08FrameDecoder | vert.x-eventloop-thread-3 | Decoding WebSocket Frame length=7 2018-04-13 13:58:31.701 | DEBUG | LoggingHandler | vert.x-eventloop-thread-3 | [id: 0x6b76bf39, L:/<Server>:51382 - R:<Remote>:443] CLOSE 2018-04-13 13:58:31.705 | DEBUG | LoggingHandler | vert.x-eventloop-thread-3 | [id: 0x6b76bf39, L:/<Server>:51382 ! R:<Remote>:443] READ COMPLETE 2018-04-13 13:58:31.705 | DEBUG | LoggingHandler | vert.x-eventloop-thread-3 | [id: 0x6b76bf39, L:/<Server>:51382 ! R:<Remote>:443] USER_EVENT: SslCloseCompletionEvent(java.nio.channels.ClosedChannelException) 2018-04-13 13:58:31.705 | DEBUG | LoggingHandler | vert.x-eventloop-thread-3 | [id: 0x6b76bf39, L:/<Server>:51382 ! R:<Remote>:443] INACTIVE 2018-04-13 13:58:31.705 | DEBUG | LoggingHandler | vert.x-eventloop-thread-3 | [id: 0x6b76bf39, L:/<Server>:51382 ! R:<Remote>:443] UNREGISTERED
We don’t see an opCode (8) to indicate a close, yet we see a CLOSE event after processing a ‘continue frame’ (opCode=0)
This pattern of close followed by a continuous frame has been consistent in all the disconnects we have seen so far. Since there are no exceptions seen in the log, it was not clear what the exact reason for the close, or who initiated it.
Can you please help understand a probable cause for the CLOSE? Is there anything in addition to enabling debug logging that we can do to get more information regarding this close? I have looked in code, but was difficult to figure the flow.
Expected behavior
Websocket should not be closed
Actual behavior
WebSocket closes with a CLOSE event
Steps to reproduce
Happens randomly, and were not successful at reproducing.
Minimal yet complete reproducer code (or URL to code)
Netty version
4.0.15
JVM version (e.g. java -version
)
Java 8
OS version (e.g. uname -a
)
Linux 2.6.32-573.26.1.el6.x86_64 CentOS 6.7
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
@normanmaurer Unfortunately Vert.x 3.5.1 doesn’t include support for ‘permessage-deflate’ compression. My App was built off a branch off 3.5.0 with support for pm-deflate. I’ll have to try porting that change over to 3.5.1. I’ll try upgrading.
I will close this for now… Please re-open if you think there is a netty issue.