From: kris.hanekamp@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:71421] [Ruby trunk - Bug #11671] [Open] Net::HTTP uses closed keep-alive connection, causing EOFError
Date: Mon, 09 Nov 2015 16:26:59 +0000 [thread overview]
Message-ID: <redmine.issue-11671.20151109162659.e27783d1de4d5bb6@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-11671.20151109162659@ruby-lang.org
Issue #11671 has been reported by Kristian Hanekamp.
----------------------------------------
Bug #11671: Net::HTTP uses closed keep-alive connection, causing EOFError
https://bugs.ruby-lang.org/issues/11671
* Author: Kristian Hanekamp
* Status: Open
* Priority: Normal
* Assignee: Yui NARUSE
* ruby -v: trunk
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Most HTTP servers close idle keep-alive connections after a timeout. For the client, this leads to the TCP socket reaching End-Of-File (EOF). Currently, `Net::HTTP` does not check for EOF before reusing a keep-alive connection, causing an `EOFError`.
For idempotent requests (for example GET), this does not do much harm, since Net::HTTP simply retries the request. But this does not work for requests that aren't idempotent like POST, so `HTTP#post` will raise an unnecessary `EOFError`.
My suggestion is to check for EOF before reusing a keep-alive connection.
I've prepared a Github PR for this: https://github.com/ruby/ruby/pull/1089
--
https://bugs.ruby-lang.org/
next parent reply other threads:[~2015-11-09 16:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-11671.20151109162659@ruby-lang.org>
2015-11-09 16:26 ` kris.hanekamp [this message]
2015-12-18 3:50 ` [ruby-core:72236] [Ruby trunk - Bug #11671] [Closed] Net::HTTP uses closed keep-alive connection, causing EOFError naruse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.issue-11671.20151109162659.e27783d1de4d5bb6@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).