lib/pitchfork.rb in pitchfork-0.5.0 vs lib/pitchfork.rb in pitchfork-0.6.0
- old
+ new
@@ -24,13 +24,14 @@
# Raised inside TeeInput when a client closes the socket inside the
# application dispatch. This is always raised with an empty backtrace
# since there is nothing in the application stack that is responsible
# for client shutdowns/disconnects. This exception is visible to Rack
- # applications unless PrereadInput middleware is loaded. This
- # is a subclass of the standard EOFError class and applications should
- # not rescue it explicitly, but rescue EOFError instead.
+ # applications. This is a subclass of the standard EOFError class and
+ # applications should not rescue it explicitly, but rescue EOFError instead.
+ # Such an error is likely an indication that the reverse proxy in front
+ # of Pitchfork isn't properly buffering requests.
ClientShutdown = Class.new(EOFError)
BootFailure = Class.new(StandardError)
# :stopdoc:
@@ -118,11 +119,14 @@
else
raise
end
end
- def self.clean_fork(&block)
+ def self.clean_fork(setpgid: true, &block)
if pid = Process.fork
+ if setpgid
+ Process.setpgid(pid, pid) # Make into a group leader
+ end
return pid
end
begin
# Pitchfork recursively refork the worker processes.