drbrain / net-http-persistent

Thread-safe persistent connections with Net::HTTP
http://seattlerb.rubyforge.org/net-http-persistent
339 stars 117 forks source link

Ruby 2.0 IOErrors #41

Closed andrewvc closed 10 years ago

andrewvc commented 11 years ago

I'm getting this on long running tests that re-use a connection in ruby 2.0. Any ideas?

Net::HTTP::Persistent::Error:
       too many connection resets (due to closed stream - IOError) after 0 requests on 70256438811280, last used 1369411589.016047 seconds ago
     # /Users/andrewcholakian/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/net-http-persistent-2.8/lib/net/http/persistent.rb:959:in `rescue in request'
     # /Users/andrewcholakian/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/net-http-persistent-2.8/lib/net/http/persistent.rb:968:in `request'
     # /Users/andrewcholakian/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/faraday-0.8.7/lib/faraday/adapter/net_http_persistent.rb:17:in `perform_request'
drbrain commented 11 years ago

The exception indicates the connection was closed, likely before you were able to read from the server.

I'll preserve the original backtrace in the exception to help track this down.

dylanahsmith commented 10 years ago

Are you using fakeweb at all?

If so, then this pull request will probably explain and fix your problem: https://github.com/chrisk/fakeweb/pull/43