From: Eric Wong <firstname.lastname@example.org> To: Michael Fischer <email@example.com> Cc: unicorn-public <firstname.lastname@example.org> Subject: Re: nginx reverse proxy getting ECONNRESET Date: Wed, 25 Mar 2015 10:12:07 +0000 [thread overview] Message-ID: <20150325101207.GA30908@dcvr.yhbt.net> (raw) In-Reply-To: <CABHxtY4Ba1rsGKQiTHCX250CcD871oOW3oqBxgFnELg8iw7FCw@mail.gmail.com> Michael Fischer <email@example.com> wrote: > On Tue, Mar 24, 2015 at 11:55 PM, Eric Wong <firstname.lastname@example.org> wrote: > > > Actually, are you getting 502 errors returned from nginx in this case? > > That would not be harmless. I suggest ensuring rack.input is > > fully-drained if that is the case (perhaps using PrereadInput). > > No, they're all 200 responses with a zero-length body size. It's the > first time I'd ever seen such a combination of symptoms. OK, thanks for the update. I was wondering if including a Unicorn::PostreadInput middleware should be introduced to quiet your logs. It should have the same effect as PrereadInput, but should provide better performance in the common case and also be compatible with "rewindable_input false" users. class Unicorn::PostreadInput def initialize(app) @app = app end def call(env) input = env["rack.input"] # save it here, in case the app reassigns it @app.call(env) ensure # Ensure the HTTP request is entirely read off the socket even # if the app aborts early. This should prevent nginx from # complaining about ECONNRESET errors. unless env["rack.hijack_io"] buf = '' true while input.read(16384, buf) buf.clear end end end (totally untested) "Postread" doesn't sound quite right, though...
next prev parent reply other threads:[~2015-03-25 10:12 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-03-24 22:43 Michael Fischer 2015-03-24 22:54 ` Eric Wong 2015-03-24 22:59 ` Eric Wong 2015-03-24 23:04 ` Michael Fischer 2015-03-24 23:23 ` Eric Wong 2015-03-24 23:29 ` Michael Fischer 2015-03-24 23:46 ` Eric Wong 2015-03-24 23:55 ` Eric Wong 2015-03-25 9:41 ` Michael Fischer 2015-03-25 10:12 ` Eric Wong [this message] 2015-03-25 9:48 ` Michael Fischer 2015-03-24 23:02 ` Michael Fischer 2015-04-08 16:22 Gabe Martin-Dempesy
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-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style List information: https://yhbt.net/unicorn/ * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20150325101207.GA30908@dcvr.yhbt.net \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --subject='Re: nginx reverse proxy getting ECONNRESET' \ /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
Code repositories for project(s) associated with this inbox: ../../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).