Merge pull request #1735 from ajbeamon/fix-load-balanced-reply-error-initialization

LoadBalancedReplies were sending uninitialized versions of their subc…
This commit is contained in:
Evan Tschannen 2019-06-20 14:27:38 -07:00 committed by GitHub
commit 55cf429cc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View File

@ -401,7 +401,7 @@ private:
public:
bool orEqual; // (or equal to key, if this is true)
int offset; // and then move forward this many items (or backward if negative)
KeySelectorRef() {}
KeySelectorRef() : orEqual(false), offset(0) {}
KeySelectorRef( const KeyRef& key, bool orEqual, int offset ) : orEqual(orEqual), offset(offset) {
setKey(key);
}

View File

@ -163,6 +163,8 @@ struct GetKeyValuesReply : public LoadBalancedReply {
Version version; // useful when latestVersion was requested
bool more;
GetKeyValuesReply() : version(invalidVersion), more(false) {}
template <class Ar>
void serialize( Ar& ar ) {
serializer(ar, *(LoadBalancedReply*)this, data, version, more, arena);

View File

@ -65,6 +65,7 @@ struct ModelHolder : NonCopyable, public ReferenceCounted<ModelHolder> {
}
};
// Subclasses must initialize all members in their default constructors
struct LoadBalancedReply {
double penalty;
Optional<Error> error;