On Fri, 30 May 2003, Craig Manley wrote:
[...]
> The big problem i often get is that the the LWP::UserAgent->request method
> returns after sending the request, but $response->is_success is false and
> $response->status_line is "500 read timeout".
>
> I've verified that these requests are actually received by the other servers
> which means no real timeout actually occured.

The fact that the server has received an HTTP request doesn't mean that
the client has necessarily received the resulting response.  Look at the
HTTP traffic with a TCP sniffer (ethereal, for example), and you'd expect
to see that the server isn't responding to the POST.

Probably, the solution is to increase the client timeout, fix the server
to be more responsive, or kludge around the problem by setting the timeout
to a small value and taking a 500 response to be successful (not
recommended!).


> I've also measured the time it takes to execute the
> LWP::UserAgent->request() method and when these 'timeouts' occur, the
> elapsed time is around 0.1 seconds.

That does sound unreasonably short, doesn't it?  The default is 180
seconds, according to the docs.  I know this is obvious, but are you
certain you're not setting the timeout somewhere (I haven't read your
code) -- either in the UserAgent constructor or with the timeout method?
OTOH, have you tried explicitly setting it?

$ua->timeout(180);


John

Reply via email to