Http timeout errors

I’ve been running a script against our web server that continually reads in
the home page and dumps any errors to file.

Overnight I got 5 errors – 2 like this:

socket read timeout (60 sec)

…and 3 like this:

A connection attempt failed because the connected party
did not properly respond after a period of time, or
established connection failed because connected host
has failed to respond. - “connect(2)”

Same script:

def ping
h = Net::HTTP.new(‘www.x.com’, 80)
h.open_timeout = 60
h.read_timeout = 60
resp = h.get2(’/index.html’, nil ) # get2 won’t raise an exception
[resp.code, resp.message, resp.body[0…500]]
end

… I understand a read timeout of 60, but why aren’t all my errors like
that? What causes the second error to occur, because it essentially says it
was a timeout, right?

Chris
http://clabs.org

A read timeout is on an already established connection, this error seems
to come from the socket not being established at all.

It should be an exception like Errno::ETIMEDOUT (if you used #get)

···

Chris Morris (chrismo@clabs.org) wrote:

A connection attempt failed because the connected party
did not properly respond after a period of time, or
established connection failed because connected host
has failed to respond. - “connect(2)”

… I understand a read timeout of 60, but why aren’t all my errors like
that? What causes the second error to occur, because it essentially says it
was a timeout, right?


Eric Hodel - drbrain@segment7.net - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

Ah – thanks!

···

----- Original Message -----
From: “Eric Hodel” drbrain@segment7.net
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Monday, February 17, 2003 2:11 PM
Subject: Re: http timeout errors

A read timeout is on an already established connection, this error seems
to come from the socket not being established at all.

It should be an exception like Errno::ETIMEDOUT (if you used #get)