Hi all,
The following code causes ruby to hang on Linux CentOS 4 (tested on
1.8.2, 1.8.3, 1.8.4 and 1.9 HEAD as of last night):
====
#!/usr/bin/env ruby
require ‘drb’
This works fine
File.read(’/proc/loadavg’)
Start the DRb server thread
DRb.start_service
This works fine - accessing normal file
File.read(’/etc/passwd’)
This call causes the program to hang
File.read(’/proc/loadavg’)
It seems that attempting to access anything in the /proc filesystem
causes DRb to block on a select call, as evident in this strace:
The fd’s that select is waiting on are these:
lrwx------ 1 dfelstead dfelstead 64 Feb 18 20:18 3 -> socket:[1130388]
lr-x------ 1 dfelstead dfelstead 64 Feb 18 20:18 4 -> /proc/loadavg
This happens regardless of the way that DRb is opened, whether or not
it is in a separate thread or not, etc. I’ve also had it happen when
accessing other, normal fs files, (it blocks on an ‘accept’ call in
that case) but I haven’t been able to reproduce it relaibly. This
example fails every time for me.
Any ideas?
Cheers!
-David F.