-
-
Notifications
You must be signed in to change notification settings - Fork 287
Closed
Description
🖼️ Context
My team recently upgraded from v0.93.1 to v0.94.0 and began experiencing errors being raised when making requests. This hasn't been happening on every request. It has been happening sporadically enough that it took a couple weeks to identify Excon as the source of the error. After reverting to use v0.93.1 we are no longer experiencing any issues.
📝 Notes
I looked through the commits that make up the changes for v0.94.0 and noticed that, as of 7ac3568, max_length is handled differently in Socket#read_nonblock. This value (max_length) is later given to String#slice!, which raises the error we've been experiencing. While it seems likely, I haven't determined for certain that this is the cause of the regression.
Before:
if max_length
until @read_buffer.length >= max_length
@read_buffer << @socket.read_nonblock(max_length - @read_buffer.length)
endAfter:
while !@backend_eof && (!max_length || @read_buffer.length < max_length)
@read_buffer << @socket.read_nonblock(@data[:chunk_size])🔎 Stack trace
Excon::Error::Socket: bignum too big to convert into `long' (RangeError)
from /usr/local/bundle/gems/excon-0.94.0/lib/excon/socket.rb:221:in `slice!'
from /usr/local/bundle/gems/excon-0.94.0/lib/excon/socket.rb:221:in `read_nonblock'
from /usr/local/bundle/gems/excon-0.94.0/lib/excon/socket.rb:58:in `read'
from /usr/local/bundle/gems/excon-0.94.0/lib/excon/response.rb:133:in `parse'
from /usr/local/bundle/gems/excon-0.94.0/lib/excon/middlewares/response_parser.rb:7:in `response_call'
from /usr/local/bundle/gems/excon-0.94.0/lib/excon/connection.rb:456:in `response'
from /usr/local/bundle/gems/excon-0.94.0/lib/excon/connection.rb:287:in `request'
from /usr/local/bundle/gems/excon-0.94.0/lib/excon/middlewares/idempotent.rb:50:in `error_call'
from /usr/local/bundle/gems/excon-0.94.0/lib/excon/middlewares/base.rb:17:in `error_call'
from /usr/local/bundle/gems/excon-0.94.0/lib/excon/middlewares/base.rb:17:in `error_call'
from /usr/local/bundle/gems/excon-0.94.0/lib/excon/connection.rb:312:in `rescue in request'
from /usr/local/bundle/gems/excon-0.94.0/lib/excon/connection.rb:227:in `request'
from /usr/local/bundle/gems/excon-0.94.0/lib/excon/middlewares/idempotent.rb:50:in `error_call'
from /usr/local/bundle/gems/excon-0.94.0/lib/excon/middlewares/base.rb:17:in `error_call'
from /usr/local/bundle/gems/excon-0.94.0/lib/excon/middlewares/base.rb:17:in `error_call'
from /usr/local/bundle/gems/excon-0.94.0/lib/excon/connection.rb:312:in `rescue in request'
from /usr/local/bundle/gems/excon-0.94.0/lib/excon/connection.rb:227:in `request'
from /usr/local/bundle/gems/excon-0.94.0/lib/excon.rb:250:in `get'
deivid-rodriguez
Metadata
Metadata
Assignees
Labels
No labels