Skip to content

Use write timeout when body_stream is used #4564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

miguelfteixeira
Copy link

The existing implementation of Net::HTTP#write_timeout relies on
Net::BefferedIO to trigger the Net::WriteTimeout error. This commit
changes send_request_with_body_stream to remove the optimization that
was making Net::HTTP#write_timeout not work when body_stream is
used.

This issue affects multipart requests from third-party libraries that wrap
Net::HTTP like Faraday.

Open issue:
https://bugs.ruby-lang.org/issues/17933

The existing implementation of `Net::HTTP#write_timeout` relies on
`Net::BefferedIO` to trigger the `Net::WriteTimeout` error. This commit
changes `send_request_with_body_stream` to remove the optimization that
was making `Net::HTTP#write_timeout` not work when `body_stream` is
used.

Open issue:
https://bugs.ruby-lang.org/issues/17933
@jeremyevans
Copy link
Contributor

Please submit this upstream to https://github.com/ruby/net-http

@miguelfteixeira
Copy link
Author

Done: ruby/net-http#27
Should I close this PR @jeremyevans ?

@jeremyevans
Copy link
Contributor

It's probably best. If ruby/net-http#27 is committed, it will eventually be merged into this repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants