# Timeout errors using Net::HTTP on Windows

**URL:** <https://www.ruby-forum.com/t/timeout-errors-using-net-http-on-windows/92267>\
**Category:** Ruby\
**Created:** [April 17, 2007, 6:15pm UTC](https://www.ruby-forum.com/t/timeout-errors-using-net-http-on-windows/92267 "2007-04-17T18:15:41Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 17, 2007, 6:15pm UTC](https://www.ruby-forum.com/t/timeout-errors-using-net-http-on-windows/92267/1 "2007-04-17T18:15:41Z")

</div>

Hi all,

I’m having a problem here running some file upload code on Windows. I’ve  
installed Ruby 1.8.6 from the one-click installer on Windows 2000 Server  
in VMware and on real hardware with Windows XP. The client, when running  
on Windows, always times/errors out no matter what. Here’s the error:

c:/ruby/lib/ruby/1.8/net/http.rb:2094:in `error!': 408 "Request Timeout " (Net::HTTPServerException) from c:/ruby/lib/ruby/1.8/net/http.rb:2103:in `value’  
from put\_client.rb:25:in `upload_file' from c:/ruby/lib/ruby/1.8/net/http.rb:543:in `start’  
from put\_client.rb:20:in `upload\_file’  
from put\_client.rb:30

Here is the client code that is causing the problems:

require 'net/https'

def upload\_file url, file  
uri = URI.parse url  
http = Net::HTTP.new uri.host, uri.port  
if uri.scheme == ‘https’  
http.use\_ssl = true  
http.verify\_mode = OpenSSL::SSL::VERIFY\_NONE  
end

if file.respond\_to? :read  
file.rewind  
stream = file  
length = File.size file.path  
else  
stream = File.open file  
length = File.size file  
end

http.start do  
req = Net::HTTP::Put.new uri.path  
req.body\_stream = stream  
req.content\_length = length  
resp = http.request req  
resp.value  
end  
end

if **FILE** == $0  
upload\_file “[http://localhost:8443/junk](http://localhost:8443/junk)”, ARGV.shift  
end

Here is some server code I was using to test:

require 'webrick'

s = WEBrick::HTTPServer.new(:Port =\> 8443)

class PutServlet \< WEBrick::HTTPServlet::AbstractServlet  
def do\_PUT(req, res)  
res[‘Content-Type’] = “text/html”  
res.body = “Uploaded #{req.body}”  
end  
end

s.mount(“/”, PutServlet)  
trap(“INT”){ s.shutdown }  
s.start

This only happens on Windows and it happens irrespective of the web  
server involved. I’ve tried this on Mac OS X (WEBrick and nginx) and it  
works fine. Running the client on Windows, though, I’ve tried this  
against WEBrick and nginx and both exhibit the same behavior when  
running the client from Windows.

Any ideas? Thanks.

–  
Toby DiPasquale

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 17, 2007, 7:19pm UTC](https://www.ruby-forum.com/t/timeout-errors-using-net-http-on-windows/92267/2 "2007-04-17T19:19:46Z")

</div>

Toby DiPasquale wrote:

> I’m having a problem here running some file upload code on Windows. I’ve  
> installed Ruby 1.8.6 from the one-click installer on Windows 2000 Server  
> in VMware and on real hardware with Windows XP. The client, when running  
> on Windows, always times/errors out no matter what. Here’s the error:
> 
> c:/ruby/lib/ruby/1.8/net/http.rb:2094:in `error!': 408 "Request Timeout " (Net::HTTPServerException) from c:/ruby/lib/ruby/1.8/net/http.rb:2103:in`value’  
> from put\_client.rb:25:in `upload_file' from c:/ruby/lib/ruby/1.8/net/http.rb:543:in`start’  
> from put\_client.rb:20:in `upload\_file’  
> from put\_client.rb:30

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’  
from c:/ruby/lib/ruby/1.8/timeout.rb:76:in `timeout' from c:/ruby/lib/ruby/1.8/net/protocol.rb:132:in`rbuf\_fill’  
from c:/ruby/lib/ruby/1.8/net/protocol.rb:116:in `readuntil' from c:/ruby/lib/ruby/1.8/net/protocol.rb:126:in`readline’  
from c:/ruby/lib/ruby/1.8/net/http.rb:2017:in `read_status_line' from c:/ruby/lib/ruby/1.8/net/http.rb:2006:in`read\_new’  
from c:/ruby/lib/ruby/1.8/net/http.rb:1047:in `request' from put_client.rb:25:in`upload\_file’  
from c:/ruby/lib/ruby/1.8/net/http.rb:543:in `start' from put_client.rb:21:in`upload\_file’  
from put\_client.rb:31

I’ve been looking on the engines for answers to this issue, both before  
and after I posted, but it seems that whenever this has come up in the  
past, the query has gone unanswered or was unrelated to this particular  
problem.

–  
Toby DiPasquale

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 18, 2007, 4:48am UTC](https://www.ruby-forum.com/t/timeout-errors-using-net-http-on-windows/92267/3 "2007-04-18T04:48:46Z")

</div>

Toby Dipasquale wrote:

> Toby DiPasquale wrote:
> 
> > I’m having a problem here running some file upload code on Windows. I’ve  
> > installed Ruby 1.8.6 from the one-click installer on Windows 2000 Server  
> > in VMware and on real hardware with Windows XP. The client, when running  
> > on Windows, always times/errors out no matter what. Here’s the error:
> > 
> > c:/ruby/lib/ruby/1.8/net/http.rb:2094:in `error!': 408 "Request Timeout " (Net::HTTPServerException) from c:/ruby/lib/ruby/1.8/net/http.rb:2103:in `value’  
> > from put\_client.rb:25:in `upload_file' from c:/ruby/lib/ruby/1.8/net/http.rb:543:in `start’  
> > from put\_client.rb:20:in `upload\_file’  
> > from put\_client.rb:30
> 
> 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’  
> from c:/ruby/lib/ruby/1.8/timeout.rb:76:in `timeout' from c:/ruby/lib/ruby/1.8/net/protocol.rb:132:in `rbuf\_fill’  
> from c:/ruby/lib/ruby/1.8/net/protocol.rb:116:in `readuntil' from c:/ruby/lib/ruby/1.8/net/protocol.rb:126:in `readline’  
> from c:/ruby/lib/ruby/1.8/net/http.rb:2017:in `read_status_line' from c:/ruby/lib/ruby/1.8/net/http.rb:2006:in `read\_new’  
> from c:/ruby/lib/ruby/1.8/net/http.rb:1047:in `request' from put_client.rb:25:in `upload\_file’  
> from c:/ruby/lib/ruby/1.8/net/http.rb:543:in `start' from put_client.rb:21:in `upload\_file’  
> from put\_client.rb:31
> 
> I’ve been looking on the engines for answers to this issue, both before  
> and after I posted, but it seems that whenever this has come up in the  
> past, the query has gone unanswered or was unrelated to this particular  
> problem.

For posterity: as described and discussed here:

[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/229801](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  
made. Cygwin is not an option for me, so I will have to switch to a  
different language. Thanks anyway.

–  
Toby DiPasquale

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 23, 2007, 3:54am UTC](https://www.ruby-forum.com/t/timeout-errors-using-net-http-on-windows/92267/4 "2007-04-23T03:54:33Z")

</div>

Emilio T. wrote:

> On 4/17/07, Toby DiPasquale [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > ```
> > from put_client.rb:25:in `upload_file'
> > 
> > ```
> > 
> > uri = URI.parse url  
> > else  
> > end  
> > require ‘webrick’  
> > s.mount(“/”, PutServlet)  
> > Any ideas? Thanks.  
> > You could try something like:  
> > def method  
> > begin  
> > response = Timeout::timeout(5) { Net::(whatever u want from NET  
> > Class) }  
> > …  
> > rescue Timeout::Error  
> > puts ‘Timeout!!!’  
> > …  
> > end  
> > end
> 
> Hope it helps you!

This would not help as the problem it the use of the timeout module in  
the first place. The net/protocol module already wraps the call in a  
Timeout::timeout() call and this is the source of the issue. That call  
spawns a Ruby thread to enforce the timeout and the combination of the  
thread use and I/O is what is triggering the problem. In any case, I’ve  
already rewritten the code in Python and it works fine on all platforms.  
Thanks anyway.

–  
Toby DiPasquale

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 18, 2007, 4:49pm UTC](https://www.ruby-forum.com/t/timeout-errors-using-net-http-on-windows/92267/5 "2007-04-18T16:49:52Z")

</div>

On 4/17/07, Toby DiPasquale [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> from put_client.rb:25:in `upload_file'
> 
> ```
> 
> uri = URI.parse url  
> else  
> end  
> require ‘webrick’  
> s.mount(“/”, PutServlet)  
> Any ideas? Thanks.  
> You could try something like:  
> def method  
> begin  
> response = Timeout::timeout(5) { Net::(whatever u want from NET  
> Class) }  
> …  
> rescue Timeout::Error  
> puts ‘Timeout!!!’  
> …  
> end  
> end

Hope it helps you!

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 5, 2007, 4:24am UTC](https://www.ruby-forum.com/t/timeout-errors-using-net-http-on-windows/92267/6 "2007-06-05T04:24:09Z")

</div>

Interesting results!!! What an understatement!! How on earth did you  
figure that out? It worked like a charm. Initially my problem was just  
that the HTTP request took FOREVER… then i started randomly getting  
the timeout errors mentioned above. I went into the net/protocol.rb file  
and made this change and voila!. Not only did the errors go away, but  
the request takes literally 1/30th of the time it did before it  
eventually got the data or even timed out… Marcin Coles, you are the  
genius of the day! Thank you!

Marcin Coles wrote:

> Well, I’m no expert, and I certainly wasn’t going to learn another  
> language, so I decided to do some tests because this was a problem for  
> me too.
> 
> I went into protocol.rb, to the rbuf\_fill method (where it actually  
> starts the timeout thread).
> 
> the code there was
> 
> def rbuf\_fill  
> timeout(@read\_timeout) {  
> @rbuf \<\< @io.sysread(1024)  
> }  
> end
> 
> now timeout takes 2 parameters - a time in seconds(?) and an exception  
> class to raise (defaults to Error).
> 
> 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
> 
> Obviously this is not exactly extensively tested - but an interesting  
> results.
> 
> Marcin

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 5, 2007, 12:57pm UTC](https://www.ruby-forum.com/t/timeout-errors-using-net-http-on-windows/92267/7 "2007-06-05T12:57:21Z")

</div>

Hey Ben  
I’m glad it worked for you too, and thanks for the compliment. I was  
happy to just get rid of those untrappable errors, so I didn’t even  
profile to see whether there were any other speed improvements -  
performance is not a critical issue in my script.

Cheers,  
M

Ben Brightwell wrote:

> Interesting results!!! What an understatement!! How on earth did you  
> figure that out? It worked like a charm. Initially my problem was just  
> that the HTTP request took FOREVER… then i started randomly getting  
> the timeout errors mentioned above. I went into the net/protocol.rb file  
> and made this change and voila!. Not only did the errors go away, but  
> the request takes literally 1/30th of the time it did before it  
> eventually got the data or even timed out… Marcin Coles, you are the  
> genius of the day! Thank you!
> 
> Marcin Coles wrote:
> 
> > Well, I’m no expert, and I certainly wasn’t going to learn another  
> > language, so I decided to do some tests because this was a problem for  
> > me too.
> > 
> > I went into protocol.rb, to the rbuf\_fill method (where it actually  
> > starts the timeout thread).
> > 
> > the code there was
> > 
> > def rbuf\_fill  
> > timeout(@read\_timeout) {  
> > @rbuf \<\< @io.sysread(1024)  
> > }  
> > end
> > 
> > now timeout takes 2 parameters - a time in seconds(?) and an exception  
> > class to raise (defaults to Error).
> > 
> > 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
> > 
> > Obviously this is not exactly extensively tested - but an interesting  
> > results.
> > 
> > Marcin

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 1, 2007, 4:29am UTC](https://www.ruby-forum.com/t/timeout-errors-using-net-http-on-windows/92267/8 "2007-05-01T04:29:55Z")

</div>

Well, I’m no expert, and I certainly wasn’t going to learn another  
language, so I decided to do some tests because this was a problem for  
me too.

I went into protocol.rb, to the rbuf\_fill method (where it actually  
starts the timeout thread).

the code there was

def rbuf\_fill  
timeout(@read\_timeout) {  
@rbuf \<\< @io.sysread(1024)  
}  
end

now timeout takes 2 parameters - a time in seconds(?) and an exception  
class to raise (defaults to Error).

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

Obviously this is not exactly extensively tested - but an interesting  
results.

Marcin

Toby Dipasquale wrote:

> Emilio T. wrote:
> 
> > On 4/17/07, Toby DiPasquale [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> > 
> > > ```
> > > from put_client.rb:25:in `upload_file'
> > > 
> > > ```
> > > 
> > > uri = URI.parse url  
> > > else  
> > > end  
> > > require ‘webrick’  
> > > s.mount(“/”, PutServlet)  
> > > Any ideas? Thanks.  
> > > You could try something like:  
> > > def method  
> > > begin  
> > > response = Timeout::timeout(5) { Net::(whatever u want from NET  
> > > Class) }  
> > > …  
> > > rescue Timeout::Error  
> > > puts ‘Timeout!!!’  
> > > …  
> > > end  
> > > end
> > 
> > Hope it helps you!
> 
> This would not help as the problem it the use of the timeout module in  
> the first place. The net/protocol module already wraps the call in a  
> Timeout::timeout() call and this is the source of the issue. That call  
> spawns a Ruby thread to enforce the timeout and the combination of the  
> thread use and I/O is what is triggering the problem. In any case, I’ve  
> already rewritten the code in Python and it works fine on all platforms.  
> Thanks anyway.
> 
> –  
> Toby DiPasquale

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 30, 2007, 5:56pm UTC](https://www.ruby-forum.com/t/timeout-errors-using-net-http-on-windows/92267/9 "2007-06-30T17:56:26Z")

</div>

Hi Raghu,

Since this weird Net timeout issue has a solution now, I’d recommend  
that you spin out a series of threads to scrape your websites. That way,  
even if each thread spends a long time waiting on Net:HTTP, you still  
have lots of other threads working on other sites - aggregate wait time  
goes way down if you have 100 simultaneous HTTP requests all waiting on  
different sites. Be careful not to have too many threads request from  
the same site at the same time - not only is this bad manners but some  
systems will block you instantly if you do this.

Pragprog guys have a good little tutorial on threading which even  
includes some info on net requests (though be sure to make the changes  
described above for execution expired issues first):

[http://www.rubycentral.com/book/tut\_threads.html](http://www.rubycentral.com/book/tut_threads.html)

Steve

Raghu Kumar wrote:

> Hi,
> 
> Thanks a lot… I was struck with this problem … now I have no  
> problem.
> 
> But in my project I have lot of different web pages to scrap, is  
> anything possible to tweak so that responses are fast ?
> 
> Raghu
> 
> Ben Brightwell wrote:
> 
> > Interesting results!!! What an understatement!! How on earth did you  
> > figure that out? It worked like a charm. Initially my problem was just  
> > that the HTTP request took FOREVER… then i started randomly getting  
> > the timeout errors mentioned above. I went into the net/protocol.rb file  
> > and made this change and voila!. Not only did the errors go away, but  
> > the request takes literally 1/30th of the time it did before it  
> > eventually got the data or even timed out… Marcin Coles, you are the  
> > genius of the day! Thank you!
> > 
> > Marcin Coles wrote:
> > 
> > > Well, I’m no expert, and I certainly wasn’t going to learn another  
> > > language, so I decided to do some tests because this was a problem for  
> > > me too.
> > > 
> > > I went into protocol.rb, to the rbuf\_fill method (where it actually  
> > > starts the timeout thread).
> > > 
> > > the code there was
> > > 
> > > def rbuf\_fill  
> > > timeout(@read\_timeout) {  
> > > @rbuf \<\< @io.sysread(1024)  
> > > }  
> > > end
> > > 
> > > now timeout takes 2 parameters - a time in seconds(?) and an exception  
> > > class to raise (defaults to Error).
> > > 
> > > 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
> > > 
> > > Obviously this is not exactly extensively tested - but an interesting  
> > > results.
> > > 
> > > Marcin

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 26, 2007, 10:35am UTC](https://www.ruby-forum.com/t/timeout-errors-using-net-http-on-windows/92267/10 "2007-06-26T10:35:07Z")

</div>

Hi,

Thanks a lot… I was struck with this problem … now I have no  
problem.

But in my project I have lot of different web pages to scrap, is  
anything possible to tweak so that responses are fast ?

Raghu

Ben Brightwell wrote:

> Interesting results!!! What an understatement!! How on earth did you  
> figure that out? It worked like a charm. Initially my problem was just  
> that the HTTP request took FOREVER… then i started randomly getting  
> the timeout errors mentioned above. I went into the net/protocol.rb file  
> and made this change and voila!. Not only did the errors go away, but  
> the request takes literally 1/30th of the time it did before it  
> eventually got the data or even timed out… Marcin Coles, you are the  
> genius of the day! Thank you!
> 
> Marcin Coles wrote:
> 
> > Well, I’m no expert, and I certainly wasn’t going to learn another  
> > language, so I decided to do some tests because this was a problem for  
> > me too.
> > 
> > I went into protocol.rb, to the rbuf\_fill method (where it actually  
> > starts the timeout thread).
> > 
> > the code there was
> > 
> > def rbuf\_fill  
> > timeout(@read\_timeout) {  
> > @rbuf \<\< @io.sysread(1024)  
> > }  
> > end
> > 
> > now timeout takes 2 parameters - a time in seconds(?) and an exception  
> > class to raise (defaults to Error).
> > 
> > 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
> > 
> > Obviously this is not exactly extensively tested - but an interesting  
> > results.
> > 
> > Marcin

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 1, 2009, 5:57pm UTC](https://www.ruby-forum.com/t/timeout-errors-using-net-http-on-windows/92267/11 "2009-08-01T17:57:42Z")

</div>

On Aug 1, 2009, at 7:05 AM, Roger P. wrote:

> 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.

For information about how to correctly nest timeout() calls, please see:

[http://blog.segment7.net/articles/2006/04/11/care-and-feeding-of-timeout-timeout](http://blog.segment7.net/articles/2006/04/11/care-and-feeding-of-timeout-timeout)

James Edward G. II

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 1, 2009, 2:03pm UTC](https://www.ruby-forum.com/t/timeout-errors-using-net-http-on-windows/92267/12 "2009-08-01T14:03:54Z")

</div>

> 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](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
