make log reopens more robust in multithreaded apps
commit4b23693b9082a84433a9e6c1f358b58420176b27
authorEric Wong <normalperson@yhbt.net>
Sat, 28 Aug 2010 05:30:46 +0000 (28 05:30 +0000)
committerEric Wong <normalperson@yhbt.net>
Sat, 28 Aug 2010 06:28:04 +0000 (28 06:28 +0000)
tree180cf66753e78fcb0615b11c62f95aa4abd76863
parent096afc1a8e958cc09b4ce8b3bfe76ce056c7ed69
make log reopens more robust in multithreaded apps

IOError may occur due to race conditions as another thread
may close the file immediately after we call File#closed?
to check.

Errno::EBADF may occur in some applications that close a file
descriptor without notifying Ruby (or if two IO objects refer to
the same descriptor, possibly one of them using IO#for_fd).
lib/unicorn/util.rb