From 72ed1ceba5dbfe3656480af22740118b9e06d418 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 27 Mar 2009 00:20:24 -0700 Subject: Deferred log rotation in workers Instead of rotating logs immediately when SIGUSR1 is caught, defer it until the current client is processing is complete. This allows multi-line log messages generated by apps to not be broken up if SIGUSR1 is received while the app is running. If we're sleeping inside IO.select, we close a pipe in the exceptfds set to cause EBADF to be raised. This also adds a small reliability improvement to test_exec so we wait until signals are ready before sending USR1 to rotate logs. --- test/exec/test_exec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/exec/test_exec.rb b/test/exec/test_exec.rb index ea9fc7c..53cebf6 100644 --- a/test/exec/test_exec.rb +++ b/test/exec/test_exec.rb @@ -502,7 +502,7 @@ end lines = [] while (tries -= 1) > 0 begin - lines = File.readlines(path).grep(/worker=\d+ spawned/) + lines = File.readlines(path).grep(/worker=\d+ ready/) lines.size == nr_workers and return rescue Errno::ENOENT end -- cgit v1.2.3-24-ge0c7