https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17097754782018-02-16T13:36:33ZRuby Issue Tracking SystemRuby master - Bug #14466: Errno::ECONNRESET or Errno::EPIPE raised instead of HTTPResponse returned when POSTing with large bodyhttps://redmine.ruby-lang.org/issues/14466?journal_id=703962018-02-16T13:36:33Zcarl.hoerberg (Carl Hörberg)carl.hoerberg@gmail.com
<ul></ul><p>sk (SK Liew) wrote:</p>
<blockquote>
<p>Expected: HTTPResponse with status code of 404.<br>
Observed: Errno::ECONNRESET or Errno::EPIPE error.</p>
</blockquote>
<p>are you sure it's not the server that's aborting the connection before returning a 404? use eg. wireshark to confirm.</p> Ruby master - Bug #14466: Errno::ECONNRESET or Errno::EPIPE raised instead of HTTPResponse returned when POSTing with large bodyhttps://redmine.ruby-lang.org/issues/14466?journal_id=704332018-02-19T09:52:47Zsk (SK Liew)
<ul></ul><p>I have just confirmed with wireshark that a 404 is returned before the connection aborts.</p> Ruby master - Bug #14466: Errno::ECONNRESET or Errno::EPIPE raised instead of HTTPResponse returned when POSTing with large bodyhttps://redmine.ruby-lang.org/issues/14466?journal_id=787572019-06-20T20:04:39Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>File</strong> <a href="/attachments/7849">net-http-epipe.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/7849/net-http-epipe.patch">net-http-epipe.patch</a> added</li><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>naruse (Yui NARUSE)</i></li></ul><p>I tried this example against an nginx instance, and received normal HTTP error codes (413 or 404 depending on payload size). However, on some other webservers (OpenBSD httpd and Webrick), I did see EPIPE failures in write_nonblock. Ignoring Errno::EPIPE when sending the request allows the request to complete and return results for those webservers. Attached is a patch that does that.</p>
<p>I don't know about handling Errno::ECONNRESET. That implies the socket is no longer usable and you should not be able to read from it. I wasn't able to trigger that condition in the webservers I tested, and don't feel comfortable trying to ignore it as well.</p> Ruby master - Bug #14466: Errno::ECONNRESET or Errno::EPIPE raised instead of HTTPResponse returned when POSTing with large bodyhttps://redmine.ruby-lang.org/issues/14466?journal_id=817702019-09-27T14:44:01Zjeremyevans (Jeremy Evans)code@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>Applied in changeset <a class="changeset" title="Ignore Errno::EPIPE when sending requests in net/http An EPIPE when sending the request should b..." href="https://redmine.ruby-lang.org/projects/ruby-master/repository/git/revisions/2b6a9f3a1ffcdb00bf89798979d475c6d189d419">git|2b6a9f3a1ffcdb00bf89798979d475c6d189d419</a>.</p>
<hr>
<p>Ignore Errno::EPIPE when sending requests in net/http</p>
<p>An EPIPE when sending the request should be ignored. Even if you<br>
cannot write more data, you may still be able to read the server's<br>
response.</p>
<p>Fixes [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Errno::ECONNRESET or Errno::EPIPE raised instead of HTTPResponse returned when POSTing with large... (Closed)" href="https://redmine.ruby-lang.org/issues/14466">#14466</a>]</p>