Changeset 30534 for gs3-extensions

Show
Ignore:
Timestamp:
13.05.2016 18:18:56 (3 years ago)
Author:
ak19
Message:

1. BUGFIX. When running full-rebuild on a solr collection when the GS3 server is not running, the solrserver.pm needs to start up and stop the tomcat server to get the solr server (off tomcat) to run and ingest the documents. However, once the tomcat is started up solrserver.pm, it does not return (solrserver.pm is stuck in a while loop waiting for further output from ant start). The problem was with JDK version 1.7.0_55, as using the JRE 1.7.0_72 included with the GS307 binary works and so too does JDK 1.8.*. Dr Bainbridge solved the problem more generally by making the while loop exit when the Build Successful message of the ant start command is encountered. Dr Bainbridge also found that the call to fork() (which I'd copied into solrserver from solrjettyserver off which it was based) was no longer applicable and that the child process may similarly have got stuck. The fixes will ensure that the code will work regardless of whether anyone uses it conjunction with the buggy Java 1.7.0_55. 2. With this commit I have tested the recent refactoring of activate.pl into servercontrol.pm (and changes to buildcolutils.pm) by testing full-rebuild and incremental-rebuild.pl against both an already running GS3 server and when the server was not running. Works.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs3-extensions/solr/trunk/src/perllib/solrserver.pm

    r29711 r30534  
    415415    while (defined($line=<STARTIN>)) {      
    416416     
    417         #if ($line =~ m/^(BUILD FAILED/) { 
     417        #if ($line =~ m/^(BUILD FAILED)/) { 
    418418        print "Tomcat startup: $line"; 
    419419        #} 
    420     } 
     420        if ($line =~ m/^BUILD SUCCESSFUL/) { 
     421            last; 
     422        } 
     423    } 
     424 
     425    close(STARTIN); 
     426     
    421427    if ($self->server_running()) { 
    422428        $server_status = "explicitly-started"; 
     
    456462    print " $server_host:$server_port\n"; 
    457463         
    458     # now we know the server is ready to accept connections, fork a 
    459     # child process that continues to listen to the output and 
    460     # prints out any lines that are not INFO lines 
    461  
    462     if (fork()==0) { 
    463         # child process 
    464  
    465         my $line; 
    466         while (defined ($line = <STARTIN>)) { 
    467  
    468         # if here, then some non-trival message has been logged 
    469         print "Tomcat/Solr processing: $line"; 
    470         } 
    471         close(STARTIN); 
    472          
    473         # And now stop nicely 
    474         exit 0; 
    475     } 
    476     # otherwise let the parent continue on 
     464    # now we know the server is ready to accept connections 
    477465    } 
    478466    elsif ($server_status eq "already-running") {