yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: "Lin Jen-Shin (godfat)" <godfat@godfat.org>
Cc: yahns-public@yhbt.net, wildjcrt@gmail.com
Subject: Re: What would happen if a worker thread died?
Date: Sat, 9 May 2015 08:47:33 +0000	[thread overview]
Message-ID: <20150509084733.GA4603@dcvr.yhbt.net> (raw)
In-Reply-To: <CAA2_N1uHj2M4WLHb_TLMfNDkAdahU_ii9QWg=78WkthNaRXHOw@mail.gmail.com>

"Lin Jen-Shin (godfat)" <godfat@godfat.org> wrote:
> On Sat, May 9, 2015 at 9:03 AM, Eric Wong <e@80x24.org> 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).

  reply	other threads:[~2015-05-09  8:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-08 12:20 What would happen if a worker thread died? Lin Jen-Shin (godfat)
2015-05-08 17:03 ` Eric Wong
2015-05-08 17:36   ` Lin Jen-Shin (godfat)
2015-05-09  1:03     ` Eric Wong
2015-05-09  7:26       ` Lin Jen-Shin (godfat)
2015-05-09  8:47         ` Eric Wong [this message]
2015-05-09  9:03           ` [PATCH] worker threads log LoadError and SyntaxError, too Eric Wong
2015-05-09  9:06           ` What would happen if a worker thread died? Lin Jen-Shin (godfat)

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: http://yhbt.net/yahns/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150509084733.GA4603@dcvr.yhbt.net \
    --to=e@80x24.org \
    --cc=godfat@godfat.org \
    --cc=wildjcrt@gmail.com \
    --cc=yahns-public@yhbt.net \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	http://yhbt.net/yahns.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).