-
Notifications
You must be signed in to change notification settings - Fork 18k
encoding/gob: not decodable from another instance of same program #24126
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
Comments
Please add a minimal self-contained reproducer. Side note: registering interface type assigns a number -> type mapping. The decoding process must register the same types in the same order otherwise the type numbers do not match. Is you program written in such a way that the type-registering order is deterministic and repeatable? I've had a similar problem in cznic/ql#67. |
I just use plain |
That's the only option ;-) But the interesting information is if the're only a single call to |
Closing. Gob is working as intended. We were doing something along the lines of this: https://github.com/pjebs/GAE-Toolkit-Go/blob/master/cache/cache.go#L84 |
I have the same program running on 2 different nodes (kubernetes scaling).
I called
gob Register
and thenEncode
theinterface{}
struct and store the value in a common redis instance.This works as intended and perfectly if the
Decode
occurs from the same instance that encoded it.If the decode occurs from the other instance it fails.
I suspect the
Register
function is the culprit when dealing with encoding interfaces.Is this a bug. If not, this greatly detracts from the portability of the gob package.
The text was updated successfully, but these errors were encountered: