Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix Net::Protocol::BufferedIO#write when sending large multi-byte string #2058
This commit should fix
I'm not sure if the same issue, but I am having request body corruption when sending large multi-byte bodies, but no apparent exception.
This script reproduces it for me with appropriate body:
I can't share the request body I'm using as it has sensitive data but if your own test body from this issue doesn't reproduce, I can try to reduce my sample to something shareable.
Is this likely a different symptom of the same issue or a different issue altogether?
I just compiled 2.6 with this patch and it does fix the issue.
FWIW, this seems like a pretty major one. This brought down the entirety of all ElasticSearch bulk indexing for our site because the NDJSON bodies were corrupted to the point of being invalid JSON. Worse, some bodies were still valid JSON but the (large) fields had malformed content (i.e. corrupted semantics without corrupting syntax, though this was rarer).
EDIT: I'd like to leave a comment on https://bugs.ruby-lang.org/issues/15468 but I don't seem to see how to do that. I'll open a separate issue for this symptom if that is helpful.