Petteri Räty <[email protected]> wrote: > What follows are all the write actions related to unicorn pid file when > doing a hot restart. Seems like a bug to me that unicorn is deleting the > pid file before writing the new file. Is there a reason for it? It seems > to go against that rename that aims for an atomic replace that would > always ensure the pid file is there.
Unfortunately, pid files are inherently racy. However, I seem to recall a pid file not existing for a brief moment was needed to allow some nginx-based scripts to work. I think unicorn differs a bit from nginx here: nginx uses rename() to clear the way for a new pid file. Like unicorn, this still leaves a window where no pid file exists. Also, nginx does not create a randomly named pid file before renaming it, so there's a possibility another process can read an existing, but zero-byte file. unicorn avoids this, if a pid file exists, it has a pid inside it. _______________________________________________ Unicorn mailing list - [email protected] http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying
