Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork bomb fix #27

Merged
merged 1 commit into from
Apr 24, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Try to fix fork bomb
  • Loading branch information
pyromaniac committed Apr 24, 2013
commit a0f6eec2d8250a5066b894c304c4ecdd3143d6ee
4 changes: 2 additions & 2 deletions lib/forever/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def initialize(options={}, &block)
if forking
begin
GC.start
pids << fork { job_call(job) }
pids << Process.detach(fork { job_call(job) })
rescue Errno::EAGAIN
puts "\n\nWait all processes since os cannot create a new one\n\n"
Process.waitall
Expand All @@ -121,7 +121,7 @@ def initialize(options={}, &block)
end

# Detach zombies, our ps will be happier
pids.delete_if { |p| Process.detach(p).stop? }
pids.delete_if { |p| p.stop? }

sleep 0.5
end
Expand Down