Is it possible to restart Unicorn without downtime?

Hi,

I know that we can use sv stop unicorn then sv start unicorn to restart unicorn workers. But that will cause downtime. Killing the master with a USR2 signal is the usual way to do hot restart, as far as I know. Is it still safe to do that for Discourse? Or is there a better way to do this?

I understand that I rarely (or not at all) have to do this. But just want to know in case of emergency.

Thanks!

4 Likes

Sort of, we do:

So you would send the USR2 to the unicorn launcher that will forward the signal for you.

7 Likes

Ah. Sweet! That will do it. Thanks @sam! :slight_smile:

USR2 - reexecute the running binary. A separate QUIT should be sent to the original process once the child is verified to be up and running.

@sam According to the docs, don’t we need to send a QUIT as well?

2 Likes

Nope cause of:

https://github.com/discourse/discourse/blob/master/config/unicorn_launcher#L14-L24

3 Likes

This topic was automatically closed after 2538 days. New replies are no longer allowed.