From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS14383 205.234.109.0/24 X-Spam-Status: No, score=-0.6 required=5.0 tests=FREEMAIL_FROM, MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD,T_DKIM_INVALID shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Jesse Storimer Newsgroups: gmane.comp.lang.ruby.unicorn.general Subject: What happens when a client terminates a connection? Date: Mon, 8 Aug 2011 12:19:17 -0400 Message-ID: <20110808161915.GA49811@jessebook-2.local> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1312822345 23057 80.91.229.12 (8 Aug 2011 16:52:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 8 Aug 2011 16:52:25 +0000 (UTC) To: mongrel-unicorn@rubyforge.org Original-X-From: mongrel-unicorn-bounces@rubyforge.org Mon Aug 08 18:52:17 2011 Return-path: Envelope-to: gclrug-mongrel-unicorn@m.gmane.org X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=LnXBbdDDGuBK6KRoF0ZCEc6Z2dspKp5qGCSBypKNzcE=; b=HmUKUU8c0y7oEG81b3eBGyN8wwp89hG+WqxC0n0+u301kKNA0TiuCIWcm0bD7JR4PY Pfaoii3N5ij3VISXfoWi+hmNVg57eI6xhLq0JRpMAMiSm4VwMrtuYee6twfkeozIYv1p joruls/dr/PW1FkZVRss4LLaZxD+NYE9WKbhQ= Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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: , Original-Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org Xref: news.gmane.org gmane.comp.lang.ruby.unicorn.general:1090 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QqT3p-0005Gl-AT for gclrug-mongrel-unicorn@m.gmane.org; Mon, 08 Aug 2011 18:52:17 +0200 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 0DE841588062; Mon, 8 Aug 2011 12:52:15 -0400 (EDT) Received: from mail-yi0-f50.google.com (mail-yi0-f50.google.com [209.85.218.50]) by rubyforge.org (Postfix) with ESMTP id E631E185836C for ; Mon, 8 Aug 2011 12:19:24 -0400 (EDT) Received: by yib18 with SMTP id 18so1020673yib.23 for ; Mon, 08 Aug 2011 09:19:24 -0700 (PDT) Received: by 10.90.206.5 with SMTP id d5mr4737131agg.119.1312820362953; Mon, 08 Aug 2011 09:19:22 -0700 (PDT) Received: from jessebook-2.local (76-10-166-126.dsl.teksavvy.com [76.10.166.126]) by mx.google.com with ESMTPS id i13sm4953698ank.20.2011.08.08.09.19.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 08 Aug 2011 09:19:21 -0700 (PDT) I've been trying to understand what happens in Unicorn when a client terminates a connection, and nginx logs a 499 response code. In my debugging this can happen if the client is on a flaky connection, or if they double-click a form submit button, the first request is terminated and nginx logs a 499 response code. It seems that in this case the Rails app actually aborts the request, wherever it is in the course of it. The issue I ran into is that my app made a destructive request to an external service in the context of a request, but the client disconnected before the app was able to respond. So the external service returned its response but the request was aborted before the app was able to commit its transaction to the database, confusion ensued. Can you confirm that this is actually what happens in Unicorn when the client disconnects? I'm not seeing anything in the logs to indicate the actual behaviour. In dealing with this I'm thinking about turning on proxy_ignore_client_abort (http://wiki.nginx.org/HttpProxyModule#proxy_ignore_client_abort) so that requests that make it to the Rails app aren't aborted. Does anyone have experience with this? I can see it causing its own sorts of confusion. Jesse _______________________________________________ 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