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: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: yahns-public@yhbt.net Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 086FE1FABD; Sat, 9 May 2015 08:47:34 +0000 (UTC) Date: Sat, 9 May 2015 08:47:33 +0000 From: Eric Wong To: "Lin Jen-Shin (godfat)" Cc: yahns-public@yhbt.net, wildjcrt@gmail.com Subject: Re: What would happen if a worker thread died? Message-ID: <20150509084733.GA4603@dcvr.yhbt.net> References: <20150508170311.GA1260@dcvr.yhbt.net> <20150509010349.GA23261@dcvr.yhbt.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: "Lin Jen-Shin (godfat)" wrote: > On Sat, May 9, 2015 at 9:03 AM, Eric Wong wrote: > > Below, I'm choosing to both leave the socket open and keep the worker > > running to slow down a potentially malicious client if this happens and > > to hopefully prevent an evil client from taking others down with it. > > I am curious how this could slow down a malicious client? Because this > might somehow confuse them that the worker is still working? Right, it might not know if the app server is throttling responses or if there's packet loss on the network. Other than the small amount of memory used for the socket, it won't use other system resources once the error is logged. > A backtrace for knowing what's happening I think is quite enough for me now. > Still curious though, could this worker do anything else if this happened? > I am guessing that if the application no longer does anything, then this worker > would not do anything. Or the socket might timeout eventually? It depends on the application structure. Often apps have very different code paths for different endpoints so some endpoint being fatally broken may not affect others. A simple endpoint (e.g. static files) could function at 100% and serve other clients without any problems. Eventually the socket will timeout if the client_expire_threshold is reached, otherwise it's fairly harmless to keep the socket around (aside from memory overhead).