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.7 required=5.0 tests=MSGID_FROM_MTA_HEADER, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?q?I=F1aki_Baz_Castillo?= Newsgroups: gmane.comp.lang.ruby.unicorn.general Subject: Re: Why workers die when sending KILL to master? Date: Sun, 10 Jan 2010 00:47:04 +0100 Message-ID: <201001100047.04837.ibc@aliax.net> References: <201001092254.13966.ibc@aliax.net> <20100109224129.GD7480@dcvr.yhbt.net> <201001092358.00950.ibc@aliax.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1263080840 10183 80.91.229.12 (9 Jan 2010 23:47:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Jan 2010 23:47:20 +0000 (UTC) To: mongrel-unicorn@rubyforge.org Original-X-From: mongrel-unicorn-bounces@rubyforge.org Sun Jan 10 00:47:13 2010 Return-path: Envelope-to: gclrug-mongrel-unicorn@m.gmane.org X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org User-Agent: KMail/1.12.2 (Linux/2.6.28-16-generic; KDE/4.3.2; x86_64; ; ) In-Reply-To: <201001092358.00950.ibc@aliax.net> 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:340 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.50) id 1NTl1V-0006Jq-3j for gclrug-mongrel-unicorn@m.gmane.org; Sun, 10 Jan 2010 00:47:13 +0100 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id AF63518582D3; Sat, 9 Jan 2010 18:47:13 -0500 (EST) Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com [209.85.219.209]) by rubyforge.org (Postfix) with ESMTP id 7773618582CA for ; Sat, 9 Jan 2010 18:47:12 -0500 (EST) Received: by ewy1 with SMTP id 1so1986982ewy.8 for ; Sat, 09 Jan 2010 15:47:11 -0800 (PST) Received: by 10.213.24.1 with SMTP id t1mr6169766ebb.22.1263080831717; Sat, 09 Jan 2010 15:47:11 -0800 (PST) Received: from ibc-laptop.localnet ([212.230.46.89]) by mx.google.com with ESMTPS id 14sm17377680ewy.11.2010.01.09.15.47.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 09 Jan 2010 15:47:10 -0800 (PST) El S=E1bado, 9 de Enero de 2010, I=F1aki Baz Castillo escribi=F3: > El S=E1bado, 9 de Enero de 2010, Eric Wong escribi=F3: > > The worker_loop just compares Process.ppid with the original ppid it > > was started with. They wakeup from IO.select() every timeout/2 seconds > > to check for original_ppid !=3D ppid if the server is idle. > = > Thanks, I was expecting exactly that as the ppid changes when the master > process dies :) I've implememented the same concept for my extra-processes in a similar way: ppid =3D Process.ppid Thread.new do loop do sleep 4 if Process.ppid !=3D ppid log.fatal "master process did, exiting" exit! end end end -- = I=F1aki Baz Castillo _______________________________________________ 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