[Mongrel] Mongrel hangs with 100% CPU / EBADF (Bad file descriptor)

Roger Pack lists at ruby-forum.com
Sat Sep 27 11:20:16 EDT 2008


> gettimeofday({1219834026, 235289}, NULL) = 0
> select(4, [3], [0], [], {0, 905241})    = -1 EBADF (Bad file descriptor)
> gettimeofday({1219834026, 235477}, NULL) = 0
> select(4, [3], [0], [], {0, 905053})    = -1 EBADF (Bad file descriptor)
> gettimeofday({1219834026, 235654}, NULL) = 0
> select(4, [3], [0], [], {0, 904875})    = -1 EBADF (Bad file descriptor)
> gettimeofday({1219834026, 235829}, NULL) = 0
> select(4, [3], [0], [], {0, 904700})    = -1 EBADF (Bad file descriptor)
> gettimeofday({1219834026, 236017}, NULL) = 0
> select(4, [3], [0], [], {0, 904513})    = -1 EBADF (Bad file descriptor)
> gettimeofday({1219834026, 236192}, NULL) = 0
> select(4, [3], [0], [], {0, 904338})    = -1 EBADF (Bad file descriptor)
> gettimeofday({1219834026, 236367}, NULL) = 0
> ...
> 
> I used lsof and found that the process used 67 file descriptors (lsof -p
> PID |wc -l)
> 

You could try evented mongrel.

I think the real problem is that internally ruby's select mechanism 
isn't designed to handle -1's from select.  I'd call that a ruby bug, 
should that be the case.

In Python when this happens it raises an exception and relies on the 
caller to loop through each socket and discover the offending one.  I 
can only hope that 1.9 does better at this situation.

I beliee ruby's select also doesn't handle "more than 1024 socket 
descriptors" [it ignores those above 1024] so...I'd call it less than 
perfect.[1]

-=R
[1] 
http://rubyforge.org/tracker/index.php?func=detail&aid=20088&group_id=426&atid=1698
-- 
Posted via http://www.ruby-forum.com/.


More information about the Mongrel-users mailing list