From: Ian Jackson Date: Sat, 17 Oct 2009 16:28:30 +0000 (+0100) Subject: routesearch: check for failure of routesearch and report XCPU specially X-Git-Tag: 5.0^2~24 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=commitdiff_plain;h=9101afe763ab49064b0ac3b5ab5ea066bcbc6259 routesearch: check for failure of routesearch and report XCPU specially --- diff --git a/yarrg/TODO b/yarrg/TODO index ed81ded..f8988df 100644 --- a/yarrg/TODO +++ b/yarrg/TODO @@ -1,7 +1,5 @@ query_routesearch: - Doesn't spot routesearch dying - ap=A, ap=P turn into proper headings notes about leagues diff --git a/yarrg/web/query_routesearch b/yarrg/web/query_routesearch index 8937f28..dc8c230 100644 --- a/yarrg/web/query_routesearch +++ b/yarrg/web/query_routesearch @@ -204,6 +204,26 @@ if ($qa->{'debug'}) { print "\n"; } +$!=0; +if (!close $fh) { + die $! if $!; + die $? if $? != 24; # SIGXCPU but not in POSIX.pm :-/ + +

Search took too long and was terminated

+ +Sorry, but your query resulted in a search that took too long. +Searches are limited to <% $maxcpu |h %> seconds of CPU time to +avoid them consuming excessive resources on the server system, and to +make sure that shorter searches can still happen. + +

+Please try a search with a smaller minimum distance, or place more +restrictions on the route. + +<%perl> + return; +} + if ($concur_fail) {

Server too busy