Changeset 21588 for main


Ignore:
Timestamp:
2010-01-22T19:25:07+13:00 (14 years ago)
Author:
ak19
Message:

I think I've now fixed the bug where build operation in FLI would fail after the Fedora server was found not to have restarted yet upon creating the gsdl.xml file in the fedora/tomcat/conf/Catalina/localhost folder. The problem, it turns out, was that the tries and wait-retry args to wget would not retry if a connection is refused or a page not found is returned, and at times this would happen the very first time wget tried to access the Fedora server to check whether it was running, so it wouldn't retry anymore.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/g2futil.pm

    r17062 r21588  
    398398   
    399399    $! = 0;
    400     my $fedoraServerReady = system("wget -q --spider --waitretry=3 --tries=20 $protocol://$hostname:$port/fedora/search");
     400
     401    #my $fedoraServerReady = system("wget -q --spider --waitretry=10 --tries=20 $protocol://$hostname:$port/fedora/search");
     402    # The retries above won't work if the server isn't running:
     403    # http://www.gnu.org/software/wget/manual/wget.html
     404    #'--tries=number'
     405    # Set number of retries to number. Specify 0 or 'inf' for infinite retrying. The default is to retry 20 times,
     406    # with the exception of fatal errors like "connection refused" or "not found" (404), which ARE NOT RETRIED.
     407
     408    # retry fedora server every second for a total of 15 times until the server is ready
     409    my $fedoraServerReady = 0;
     410    my $count = 0;
     411    do {
     412    $fedoraServerReady = system("wget -q --spider $protocol://$hostname:$port/fedora/search");
     413    if($fedoraServerReady != 0) {
     414        sleep(1);
     415        $count++;
     416        #print STDERR "$count second(s)\n";
     417    }
     418    } while($fedoraServerReady != 0 && $count < 15);
     419
    401420    if($fedoraServerReady != 0) {
    402421    print STDERR "Fedora server is still not ready... ERROR: $!\n";
Note: See TracChangeset for help on using the changeset viewer.