Fix settings serialization to not serialize secure settings or not take the total size into account#25323
Merged
s1monw merged 2 commits intoelastic:masterfrom Jun 21, 2017
Conversation
…ke the total size into account
jaymode
approved these changes
Jun 20, 2017
s1monw
added a commit
that referenced
this pull request
Jun 21, 2017
…ke the total size into account (#25323)
hub-cap
pushed a commit
that referenced
this pull request
Aug 21, 2017
…ke the total size into account (#25323)
DaveCTurner
added a commit
to DaveCTurner/elasticsearch
that referenced
this pull request
Feb 21, 2018
Today, we serialize collections prefixed by their lengths. If the serialized length is inconsistent with the number of objects in the collection then the serialization succeeds but any subsequent deserialization will (almost certainly) fail, reporting something unexpected at some later point in the stream. This can happen, for instance, because of a concurrent modification (e.g. elastic#28718) to the collection in between getting its length and iterating through its objects. This is a royal pain to debug, because the failure is reported a long way from where it actually occurs. See also e.g. elastic#25323. This change adds checks to StreamOutput to verify that it wrote as many objects as it said it would, in order to catch any similar problems in future closer to their sources.
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.
No description provided.