unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [ANN] unicorn 4.3.0.2.g4551 gem prerelease
@ 2012-04-27 22:00  7% Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2012-04-27 22:00 UTC (permalink / raw)
  To: mongrel-unicorn; +Cc: Joel Nimety, George, Matt Smith

Can you guys test this out?  Thanks.  I'll make a real 4.3.1 release
tomorrow.

>From RubyGems.org:  gem install --pre unicorn

ChangeLog since v4.3.0:

commit 4551c8ad4d63d4031c618f76d39532b39e88f9be
Author: Eric Wong <normalperson@yhbt.net>
Date:   Fri Apr 27 14:42:38 2012 -0700

    stream_input: call shutdown(2) if a client EOFs on us
    
    In case the Rack app forks before a client upload is complete,
    shutdown(2) the socket to ensure the client isn't attempting to
    read from us (even if it explicitly stopped writes).

commit 04901da5ae0b4655c83be05d24ae737f1b572002
Author: Eric Wong <normalperson@yhbt.net>
Date:   Fri Apr 27 11:48:16 2012 -0700

    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
-- 
_______________________________________________
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

^ permalink raw reply	[relevance 7%]

* Re: app error: Socket is not connected (Errno::ENOTCONN)
  @ 2012-04-27 18:59  6% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2012-04-27 18:59 UTC (permalink / raw)
  To: mongrel-unicorn; +Cc: Joel Nimety, George, Matt Smith

Joel Nimety <jnimety@continuity.net> 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 <normalperson@yhbt.net>
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

^ permalink raw reply related	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2012-04-27 14:36     app error: Socket is not connected (Errno::ENOTCONN) Joel Nimety
2012-04-27 18:59  6% ` Eric Wong
2012-04-27 22:00  7% [ANN] unicorn 4.3.0.2.g4551 gem prerelease Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

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).