From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS33070 50.56.128.0/17 X-Spam-Status: No, score=-0.2 required=5.0 tests=AWL shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: archivist@yhbt.net Delivered-To: archivist@dcvr.yhbt.net Received: from rubyforge.org (50-56-192-79.static.cloud-ips.com [50.56.192.79]) by dcvr.yhbt.net (Postfix) with ESMTP id D35451F5A8 for ; Fri, 27 Apr 2012 19:07:52 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 70C6E263046; Fri, 27 Apr 2012 19:07:52 +0000 (UTC) X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by rubyforge.org (Postfix) with ESMTP id A0708263041 for ; Fri, 27 Apr 2012 18:59:41 +0000 (UTC) Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id DE7981F5AA; Fri, 27 Apr 2012 18:59:40 +0000 (UTC) Date: Fri, 27 Apr 2012 18:59:40 +0000 From: Eric Wong To: mongrel-unicorn Subject: Re: app error: Socket is not connected (Errno::ENOTCONN) Message-ID: <20120427185940.GA27312@dcvr.yhbt.net> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Joel Nimety , George , Matt Smith X-BeenThere: mongrel-unicorn@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org Joel Nimety wrote: > I'm getting the following errors multiple times per request when using > 4.3.0. I do not receive any errors when using 4.2.1. Please CC me on > replies, I'm not subscribed to the mailing list. Multiple times per request? Yikes. This can be expected occasionally. The below patch will just silently ignore them since they're not errors we can avoid/deal with any other way. I'd still prefer exceptions to not get raised at all (they're expensive). Are the rest of you guys getting these errors intermittently, or only once in a while. Rainbows! has long had a similar patch as below, but I'm a bit concerned as to why Joel is getting this multiple times per request... >>From 04901da5ae0b4655c83be05d24ae737f1b572002 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 27 Apr 2012 11:48:16 -0700 Subject: [PATCH] http_server: ignore ENOTCONN (mostly from shutdown(2)) Since there's nothing unicorn can do to avoid this error on unconnected/halfway-connected clients, ignoring ENOTCONN is a safe bet. Rainbows! has long had this rescue as it called getpeername(2) on untrusted sockets --- lib/unicorn/http_server.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb index f942e2f..14a6f9a 100644 --- a/lib/unicorn/http_server.rb +++ b/lib/unicorn/http_server.rb @@ -507,7 +507,8 @@ class Unicorn::HttpServer # the socket is closed at the end of this function def handle_error(client, e) msg = case e - when EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::EINVAL,Errno::EBADF + when EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::EINVAL,Errno::EBADF, + Errno::ENOTCONN Unicorn::Const::ERROR_500_RESPONSE when Unicorn::RequestURITooLongError Unicorn::Const::ERROR_414_RESPONSE -- Eric Wong _______________________________________________ Unicorn mailing list - mongrel-unicorn@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying