-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api: make any serialization stable for go #6241
Conversation
Signed-off-by: Kuat Yessenov <kuat@google.com>
The list of affected protos was found using |
/cc @htuch I don't have rights to re-trigger ASAN build. |
@kyessenov how does this get fixed in non-Go languages? |
@htuch That's a good question. The spec is deliberately unclear (https://developers.google.com/protocol-buffers/docs/proto#maps-features). C++ has a magic key to sort maps https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/io/coded_stream.h#L856. Other implementations probably have some other mechanisms for stable marshaling. |
@PiotrSikora @htuch @lizan We'd love to get this into Istio 1.1. In fact we really can't ship Istio 1.1 without it. |
@duderino Ack, just want to make sure we have a clear idea of whether this will be a long term fix. @kyessenov as long as this is stable for C++ at least, then I think we're all good; the main issue I wonder about is Envoy itself doing inconsistent hashing (didn't we have some upstream issue filed on this?). Should we file issues with java-control-plane? Maybe a master issue in the Envoy repo to track all work/languages and link to this in the commit message? |
Ref #6252 |
@kyessenov can you update the top comment/commit message in the GH UX with the updated reference? Thanks. |
thank you for the quick review and merge |
Description: Using proto.MarshalAny results in unstable output due to non-deterministic map ordering. This in turn causes Envoy's diff to reload a config since the hash of the structure changes.
Enable stable marshaler for gogoproto to avoid this problem. See #6252
Risk Level: low
Testing: n/a
Docs Changes: n/a
Release Notes: n/a