unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* PID files not being removed on shutdown
@ 2013-06-18 12:41 Jon Wood
  2013-06-18 16:48 ` Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Wood @ 2013-06-18 12:41 UTC (permalink / raw)
  To: mongrel-unicorn

Hello,

I'm quite consistently seeing an issue where Unicorn leaves its PID
files in place after a clean shut down, which is causing some issues
when deploying releases that update Unicorn config.

We're doing hot restarts with USR2+QUIT, and using Upstart for process
supervision based on the presence of a PID file (this admittedly might
be a mistake, but I've not seen any better solutions).

This works fine in the case of a hot restart since Unicorn correctly
updates the PID file, however when we change the configuration for
Unicorn shutting down the master process doesn't remove the PID file,
so the supervising Upstart script doesn't detect that the master has
been shut down and bring up a new one.

I've created a gist[1] of our Upstart and Unicorn configuration files.
As I say, we might just be doing something stupid here, but Google
doesn't seem to have shed any light on the issue.

Thanks for any help,
Jon

[1] https://gist.github.com/jellybob/3789c3f3a00989b63d74
_______________________________________________
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

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

* Re: PID files not being removed on shutdown
  2013-06-18 12:41 PID files not being removed on shutdown Jon Wood
@ 2013-06-18 16:48 ` Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2013-06-18 16:48 UTC (permalink / raw)
  To: unicorn list

Jon Wood <jon@hubbub.co.uk> wrote:
> Hello,
> 
> I'm quite consistently seeing an issue where Unicorn leaves its PID
> files in place after a clean shut down, which is causing some issues
> when deploying releases that update Unicorn config.
> 
> We're doing hot restarts with USR2+QUIT, and using Upstart for process
> supervision based on the presence of a PID file (this admittedly might
> be a mistake, but I've not seen any better solutions).

It's probably better to test the listening port unicorn uses
(perhaps setup a generic health check endpoint) via socat/curl
to detect if unicorn is down.

> This works fine in the case of a hot restart since Unicorn correctly
> updates the PID file, however when we change the configuration for
> Unicorn shutting down the master process doesn't remove the PID file,
> so the supervising Upstart script doesn't detect that the master has
> been shut down and bring up a new one.
> 
> I've created a gist[1] of our Upstart and Unicorn configuration files.
> As I say, we might just be doing something stupid here, but Google
> doesn't seem to have shed any light on the issue.

> [1] https://gist.github.com/jellybob/3789c3f3a00989b63d74

Do you have anything logging to stderr_path?  That might give you a
better idea of what's wrong.  Unfortunately, PID files are always bound
to be racy so perhaps supervisor scripts should test and endpoint of an
app using socat or curl.

_______________________________________________
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

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

end of thread, other threads:[~2013-06-18 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-18 12:41 PID files not being removed on shutdown Jon Wood
2013-06-18 16:48 ` Eric Wong

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

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