-
Notifications
You must be signed in to change notification settings - Fork 18k
encoding/gob: tooBig is too small #27635
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
/cc @robpike |
This was first introduced in 9c3fc83, because earlier it was easy to get My initial reaction would be "we can just bump this limit on 64-bit", or "we can just use 64-bit sized integers in the encoder and decoder", although I don't know the internals of the gob package that well. The original issue was #8084. Interestingly enough, it happened on amd64. I guess it's fine to double the limit while we don't have a better long-term solution, but I'll leave that to Rob to decide. |
@mvdan thanks for your input. I tried to looking through the gob source but I can't really make out what kind of integers are used. But what I can tell you is that I changed the data structure from |
@bf FYI, gob uses a variable-length format to encode integers, so it makes sense that changing the integer type in your data structure did not affect the output size. |
Maybe tooBig should be bigger on 64-bit. On 32-bit I think 1GB is fine. Thoughts, @robpike? |
Sure. |
Change https://golang.org/cl/143678 mentions this issue: |
16 similar comments
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
21 similar comments
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
Change https://golang.org/cl/143678 mentions this issue: |
@dmitshur what happened with gopherbot here? |
Github outage. All comments got duplicated. |
Hopefully this was the only notification email party that Gopherbot had in the issue tracker :) |
Indeed. I kept an eye on gopherbot logs (among other builder-related services that touch GitHub) during the GitHub semi-outage, and didn't spot it doing anything visibly bad. (See #28320 for what I did find, but it's unrelated to this.) Gopherbot determines if it has acted by looking if its comment already exists on an issue, so if GitHub reports the comment as not being there (as was the case), it can't help but think it hasn't acted yet and repeat the action. In other words, it relies on GitHub working. GitHub does offer a status API. If we really had to take action, we could add code that pauses gopherbot when https://status.github.com/api reports that GitHub is in poor state. But as far as I can see, gopherbot didn't do anything too outrageous and so we don't have to do that. |
What version of Go are you using (
go version
)?go version go1.10.3 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?arch linux with 16gb ram
What did you do?
I parse large CSV files for social media analytics, creating in-memory data structures from the data. When persisting these data structures to disk using
gob
, I receivegob: encoder: message too big
error from this code:One set of input data is a 4GB csv file which results in a data structure that is 200MB when saved with gob. The second set of input data is a 15GB csv file which should result in a 1200MB file when saved with gob, but I receive the error above.
The error is thrown at a check if the data structure is larger than the
tooBig
constant atgo/src/encoding/gob/encoder.go
Line 70 in 50bd1c4
The tooBig constant is originally defined with a comment
TODO: Make this adjustable
herego/src/encoding/gob/decoder.go
Line 17 in 50bd1c4
go/src/encoding/gob/decoder.go
Line 18 in 50bd1c4
What did you expect to see?
I expect gob to save large data structures of ~2GB that dont get close to my RAM limits of 16GB without any problems.
What did you see instead?
I got the
gob: encoder: message too big
error.I fixed the error by compiling my own go and changing the tooBig check in
encoder.go
to 1<<31. Afterwards the data structure from the large 15GB CSV file was successfully saved by gob in a 1500MB gob file.Therefore I suggest this change could be done for all users, as the existing TODO comment in the golang source code suggests
go/src/encoding/gob/decoder.go
Line 17 in 50bd1c4
The text was updated successfully, but these errors were encountered: