Marshall has asked for the wisdom of the Perl Monks concerning the following question:
Retry #1 took about 90 minutes!! WOW!2022-08-25 04:21:18|Good record fetched here 2022-08-25 04:21:23|Error: Retry Attempt 1 of 3 2022-08-25 05:45:16|Error: Retry Attempt 2 of 3 2022-08-25 05:45:53|Next good page fetched here
Here is what the ancient code does:
The retry ultimately succeeds but the long wait time has the effect of pushing the run time into the next hour's timeslot.my $success=0; my $tries=0; while (! $success and $tries++ < 3) { eval { $m2->get($fullurl); }; if (! $@) { $success = 1; } else { print STDERR "".cur_gmt()."Error: Retry Attempt $tries of 3\n" +; print LOG "".cur_gmt()."Error: Retry Attempt $tries of 3\n" +; sleep (2); } } die "aborted Web Site Error: $!" unless $success; #ultimate failure!! +PROGRAM ABORT !!!!
This is a normal HTTP (not HTTPS) Url. Over the years, there could be that a lot of things that have changed at the website's end. I have no idea. The default timeout for Mechanize is supposed to be about 3 minutes - it really doesn't matter to me as long as it is not measured in hours! I don't know how often this super long request problem happens. A retry historically happens about every 2-3K requests with this particular site and a couple seconds later, all is well. I have no idea what is actually causing the hang.
Thoughts and ideas are welcome.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Mechanize timeout problem
by hippo (Archbishop) on Aug 25, 2022 at 08:47 UTC | |
by Marshall (Canon) on Aug 25, 2022 at 10:46 UTC | |
by NERDVANA (Priest) on Aug 26, 2022 at 19:55 UTC |