From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 0F85F19E005C for ; Fri, 18 Dec 2015 12:18:14 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 00EC9B5D905 for ; Fri, 18 Dec 2015 12:50:21 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 494BA18CC7E3 for ; Fri, 18 Dec 2015 12:50:21 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 819AE12048A; Fri, 18 Dec 2015 12:50:20 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o2.heroku.sendgrid.net (o2.heroku.sendgrid.net [67.228.50.55]) by neon.ruby-lang.org (Postfix) with ESMTPS id E2F8C120420 for ; Fri, 18 Dec 2015 12:50:16 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=qxlxwy9PotUm43ClQjnXijYSdg0=; b=phufYUQVUwk+5+fod7 B52JFqdXLoNAqiv05zS2+tZkMJhjgncg0IYXEmjnTadnnvU6cV33MZnfmUwGSkPd UXfEyrQdKZukcV+VuCIq3QVvhQOxsyLEjiCbGLW4VuyeDy129hu/z/JvtGMb8CFM IHAUDQZxJxgozWZKe2Q3xdIKA= Received: by filter0540p1mdw1.sendgrid.net with SMTP id filter0540p1mdw1.6785.5673827533 2015-12-18 03:50:13.863769821 +0000 UTC Received: from herokuapp.com (ec2-54-145-221-125.compute-1.amazonaws.com [54.145.221.125]) by ismtpd0005p1iad1.sendgrid.net (SG) with ESMTP id 5jti2y04QTanIMkWi0gwow for ; Fri, 18 Dec 2015 03:50:13.777 +0000 (UTC) Date: Fri, 18 Dec 2015 03:50:13 +0000 From: naruse@airemix.jp To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 46946 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11671 X-Redmine-Issue-Author: krishan X-Redmine-Issue-Assignee: naruse X-Redmine-Sender: naruse X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS4omgG3sX4fD98XjkBupza/R6O1rk1WCDWU9N 1aTC49LQnDumQKlWIABBSkXmOzi9cTiGO1hk4OhF55yn4i9oshS6wsf1w+MuS6onoVayKF8sAkH/Vp D5nCEQhNHSs12eP6lzs36vnVhj8g65FAnZrF X-ML-Name: ruby-core X-Mail-Count: 72236 Subject: [ruby-core:72236] [Ruby trunk - Bug #11671] [Closed] Net::HTTP uses closed keep-alive connection, causing EOFError X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11671 has been updated by Yui NARUSE. Status changed from Open to Closed ---------------------------------------- Bug #11671: Net::HTTP uses closed keep-alive connection, causing EOFError https://bugs.ruby-lang.org/issues/11671#change-55644 * Author: Kristian Hanekamp * Status: Closed * 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/