Interesting, could well be something specific to ruby, however it wasn’t present prior to yesterday, and it hasn’t been an issue with other services that I am aware of, and this code has been static for a long time.
Also it could be that curl is handling this error condition gracefully (eg if a buffer is an incorrect size, it ignores it), while the ruby libs don’t.
It could be that there is a subtle difference in the way SSL/GZIP/short content is served from Twitter that is causing this bug. Was there a change in the server configs yesterday that might help point to which side has the bug? I can find the exact minute this problem started if you need it for reference.
EDIT: About 21:10 UTC on the 19th of March was when we first saw it start happening, and there appeared to have been a secondary, though smaller increase in the problem around 21:22 UTC.
Thanks,
JB.