mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 20:34:52 +00:00
In 6cafe59c76fd2e1151f2b8483402a6984ccd901b, we added a monkey patch to `Unicorn::HtppServer#murder_lazy_workers` to log a message and send a `USR2` signal to the Unicorn worker process when they Unicorn worker process is 2 seconds away from being timed out by the Unicorn master process. However, we ended up loggging multiple messages and sending multiple USR2 signal during the 2 seconds before the Unicorn worker process hit the time out. To overcome this problem, we will now set an instance variable on the `Unicorn::Worker` instance and use it to ensure that the log message is only logged once and USR2 signal to the Unicorn worker process is only sent one as well.