Handle ping correctly in NioTransport#25462
Merged
Tim-Brooks merged 3 commits intoelastic:masterfrom Jun 29, 2017
Merged
Conversation
s1monw
reviewed
Jun 29, 2017
| BytesReference messageWithoutHeader = message.slice(6, message.length() - 6); | ||
| handler.handleMessage(messageWithoutHeader, channel, channel.getProfile(), messageWithoutHeader.length()); | ||
|
|
||
| // A message length of 6 bytes it is just a ping. Ignore for now. |
Contributor
There was a problem hiding this comment.
right, should we check if the header is correct and if not close the connection?
Contributor
Author
There was a problem hiding this comment.
This happens in the TcpFrameDecoder here. If the header is invalid, an exception is thrown .
When the exception is caught, the channel goes through out normal exception handling (and disconnect) logic.
Contributor
There was a problem hiding this comment.
good! just leave a comment about this in the code?
Contributor
Author
There was a problem hiding this comment.
I added a comment next to the usage of frame decoder to indicate that it would thrown an exception if the message turned out to be invalid.
s1monw
approved these changes
Jun 29, 2017
Contributor
Author
|
Merged. Thanks @s1monw and @jasontedor |
jasontedor
added a commit
that referenced
this pull request
Jun 30, 2017
* master: (129 commits) Add doc note regarding explicit publish host Fix typo in name of test Add additional test for sequence-number recovery WrapperQueryBuilder should also rewrite the parsed query. Remove dead code and stale Javadoc Update defaults in documentation (#25483) [DOCS] Add docs-dir to Painless (#25482) Add concurrent deprecation logger test [DOCS] Update shared attributes for Elasticsearch (#25479) Use LRU set to reduce repeat deprecation messages Add NioTransport threads to thread name checks (#25477) Add shortcut for AbstractQueryBuilder.parseInnerQueryBuilder to QueryShardContext Prevent channel enqueue after selector close (#25478) Fix Java 9 compilation issue Remove unregistered `transport.netty.*` settings (#25476) Handle ping correctly in NioTransport (#25462) Tests: Remove platform specific assertion in NioSocketChannelTests Remove QueryParseContext from parsing QueryBuilders (#25448) Promote replica on the highest version node (#25277) test: added not null assertion ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Our current TCPTransport logic assumes that we do not pass pings to
the TCPTransport level.
This commit fixes an issue where NioTransport was passing pings to
TCPTransport and leading to exceptions.