This took just over 3 minutes (default timeout). Why didn't the timeout of 10 seconds kick in?

Note I cannot reproduce as the internal server error is fixed, but I want to avoid the lengthy timeout in future

Using perl 5.8.0, here is code snippet:

my $method = 'POST'; my $url = "https://etc"; # note: actual url not shown here my $query_string = ""; # note: actual query string not shown here my $ua = new LWP::UserAgent; $ua->timeout(10); $ua->agent('Mozilla/4.6'); $ua->cookie_jar(HTTP::Cookies->new); $request = new HTTP::Request($method,$url); $request->content_type('application/x-www-form-urlencoded'); $request->content($query_string); $response_content = $ua->request($request)->content; LWP::Debug::debug("Response:\n$response_content\n");

Debug messages are as follows:

LWP::UserAgent::new: () LWP::UserAgent::proxy: LWP::UserAgent::request: () LWP::UserAgent::send_request: POST <URL here> LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::UserAgent::request: Simple response: Internal Server Error Response: 500 Connect failed: connect: Connection timed out; Connection timed ou +t

In reply to LWP::UserAgent request ignores timeout when internal server error encountered by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.