yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
* What would happen if a worker thread died?
@ 2015-05-08 12:20 Lin Jen-Shin (godfat)
  2015-05-08 17:03 ` Eric Wong
  0 siblings, 1 reply; 8+ messages in thread
From: Lin Jen-Shin (godfat) @ 2015-05-08 12:20 UTC (permalink / raw)
  To: yahns-public; +Cc: wildjcrt

Hi,

We just tried running yahns on production, and would like to
give some feedback. Eventually we turned back to Unicorn,
but that's because apparently Rails, or to be specific,
ActiveRecord (4.1.10) is not thread safe and giving random
errors once in a while.

However, we're also trying to split out an API server which is
not running on Rails, therefore we should be able to use a
threaded server.

During the experiments, we found that whenever a worker
thread died due to LoadError raised from the application,
which is not a StandardError therefore was not rescued at all,
crashing the worker thread (assumed, not verified).

When this happened, the client just hanged forever with yahns.
Is there something we can do about this? Would yahns respawn
a new worker thread? Can we close the socket when this happen?

I am aware that yahns is *extremely sensitive to fatal bugs in the
applications it hosts*, so I am just curious.

For reference, Puma would immediately close the socket without
sending anything, and Unicorn would log the error backtrace and
kill the worker (If I read it correctly).

In this case, Unicorn helped me figure out what's happened.

Cheers,

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-05-09  9:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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)

Code repositories for project(s) associated with this public inbox

	https://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).