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 7A4EC19C003C for ; Tue, 10 Nov 2015 01:05:53 +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 49CE9B5D8EB for ; Tue, 10 Nov 2015 01:35:24 +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 408E418CC7B8 for ; Tue, 10 Nov 2015 01:35:24 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 2F1CE120476; Tue, 10 Nov 2015 01:35:22 +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 1D143120442 for ; Tue, 10 Nov 2015 01:35:17 +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=yau5T7uafPZZRV1Ee+zjH667vcQ=; b=WGuAv5q8vhR1ezYhsS z4WDMcP+ktBO8SRHQkVlhjWeqhAAkHJj3zhQ361CYMCroh0PtWpz+CiZQuPskasv 89Lc+k7EYoj+fVwDFjncB0+s3KADQ/bRP3Ow6PzulYGYtxWn965/ADFGmNNbLPfD ehGenPnSh8m/Os/AN+KTd7JII= Received: by filter-398.sjc1.sendgrid.net with SMTP id filter-398.22936.5640C9543 2015-11-09 16:27:00.029672342 +0000 UTC Received: from herokuapp.com (ec2-23-20-199-109.compute-1.amazonaws.com [23.20.199.109]) by ismtpd0005p1iad1.sendgrid.net (SG) with ESMTP id Jn8FDKAuTcaVwyXFSjzRtQ for ; Mon, 09 Nov 2015 16:26:59.996 +0000 (UTC) Date: Mon, 09 Nov 2015 16:26:59 +0000 From: kris.hanekamp@gmail.com 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: 46062 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11671 X-Redmine-Issue-Author: krishan X-Redmine-Issue-Assignee: naruse X-Redmine-Sender: krishan 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS5Fr0CyFIGbBp7hOK8IHy8sx3davUU9ThB/KE HJE0ks6/PY/vCIuvinVWHztYEogI5yTjJv55v7455uoNEHJDwq8/hHK6JJ93JBiRCINcSqS0drvhTt 8EDwrbbxkT0ASiA= X-ML-Name: ruby-core X-Mail-Count: 71421 Subject: [ruby-core:71421] [Ruby trunk - Bug #11671] [Open] 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 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/