Only shut down the current process when the memory limit is reached

Contrary to what the ruby documentation says, sending a signal
to PID 0 actually signals the whole process group, not just the
current process. So use Process.pid to make sure we only signal
the current process.
This commit is contained in:
Tom Hughes 2010-12-19 00:15:24 +00:00
parent a998a0bb20
commit a491174efa

View file

@ -18,7 +18,7 @@ if defined?(SOFT_MEMORY_LIMIT) and defined?(PhusionPassenger)
# Restart if we've hit our memory limit
if resident_size > SOFT_MEMORY_LIMIT
Process.kill("USR1", 0)
Process.kill("USR1", Process.pid)
end
# Return the result of this request