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 upAllow Net::HTTP to timeout if the remote server doesn't read the request fast enough #1575
+120
−18
Conversation
casperisfine
referenced this pull request
Apr 4, 2017
Merged
Refactor httpgenericrequest/exec_spec to use an actual Net::BufferedIO #415
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
casperisfine
Apr 4, 2017
The build fails because of RubySpec, I've opened another PR here: ruby/spec#415
casperisfine
commented
Apr 4, 2017
|
The build fails because of RubySpec, I've opened another PR here: ruby/spec#415 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
kirs
commented
May 17, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
casperisfine commentedApr 4, 2017
Patch for https://bugs.ruby-lang.org/issues/13396
Net::HTTPcurrently has no way to timeout whatsoever while sending the HTTP request, if the server accept the TCP connection but never reads inside the socket,Net::HTTPcan stay blocked forever.This patch introduced a new
write_timeoutconfiguration, and changeBufferedIO#writeto use non-blocking IO.As for chunked requests, since they use
IO.copy_stream, I couldn't find another solution than to wrap it inside aTimeout.timeoutblock.