zombocom / puma_worker_killer

Automatically restart Puma cluster workers based on max RAM available
747 stars 77 forks source link

avoid terminating workers which have been terminated last time #60

Closed DemonGiggle closed 4 years ago

DemonGiggle commented 6 years ago

the rolling restart will only update its worker list when calling get_total_memory (which implicity fetch the updated worker list from puma). That's why the next time it perform reaps it still see the same copies of workers as last time saw.

It's related to issue #46

schneems commented 6 years ago

Thanks! Sorry for the delay here, is there any way you can think to test this new behavior?

DemonGiggle commented 6 years ago

Hi I add a test for this behavior. The idea behind the test is that we create one worker and observe the terminated pids triggered by rolling restarter. If we found any duplicated ones, we will assert it.

schneems commented 4 years ago

Don't totally follow how this fixes the issue, but it seems fine to not call that method in a loop, merging in. Thanks!