From: Roger Pack Date: 2009-08-01T21:05:08+09:00 Subject: Re: Timeout errors using Net::HTTP on Windows > This error is more indicative of what I've been seeing: > c:/ruby/lib/ruby/1.8/timeout.rb:54:in `rbuf_fill': execution expired > (Timeout::Error) > from c:/ruby/lib/ruby/1.8/timeout.rb:56:in `timeout' > When I changed the code to the following, it started to work for me. > New code: > > def rbuf_fill > timeout(@read_timeout,ProtocolError) { > @rbuf << @io.sysread(1024) > } > end Anybody know if this was ever fixed? I'm unable to recreate it currently [maybe my boxes are too new so they don't trigger the problem?] > For posterity: as described and discussed here: > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/229801 > it turns out that threads and I/O don't mix in the One-Click Installer > at this time. Neither, apparently, do they mix in the MinGW builds... I don't think this was the root cause, however--the problem described here is that if you have nested timeout's Timeout.timeout(x) { begin Timeout.timeout(y) { stuff } rescue Timeout::Error # which timeout will cause this to trigger? end } The outermost timeout could timeout the inner one, causing the inner one to think it was "timed out" when it wasn't--the outer one was. Timeout and/or Thread#raise should be deprecated, I think. =r -- Posted via http://www.ruby-forum.com/.