[ 
https://issues.apache.org/jira/browse/SOLR-3301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Matheis (steffkes) updated SOLR-3301:
--------------------------------------------

    Attachment: SOLR-3301.patch

Thanks Matt, i've changed the following things:

1) Lucene is using two spaces for indentation, i replaced the tabs.

2) Your Patch did not compile:
{code}+    if (healthcheck == null) {
+      throw new SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE x, 
+        "No healthcheck file defined.");
+    }{code}
was failing with the following error(s):
{code}common.compile-core:
    [mkdir] Created dir: /opt/solr-trunk/solr/build/solr-core/classes/java
    [javac] Compiling 564 source files to 
/opt/solr-trunk/solr/build/solr-core/classes/java
    [javac] 
/opt/solr-trunk/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java:141:
 ')' expected
    [javac]       throw new 
SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE x, 
    [javac]                                                                     
     ^
    [javac] 
/opt/solr-trunk/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java:141:
 illegal start of expression
    [javac]       throw new 
SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE x, 
    [javac]                                                                     
       ^
    [javac] 
/opt/solr-trunk/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java:141:
 ';' expected
    [javac]       throw new 
SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE x, 
    [javac]                                                                     
        ^
    [javac] 
/opt/solr-trunk/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java:142:
 illegal start of expression
    [javac]         "No healthcheck file defined.");
    [javac]                                       ^
    [javac] 4 errors{code}

3) I would not expect a {{BAD_REQUEST}}-Error if Ping is not configured?
{code}+      case STATUS:
+        if( healthcheck == null){
+          SolrException e = new 
SolrException(SolrException.ErrorCode.BAD_REQUEST, "healthcheck not 
configured");
+          rsp.setException(e);
+        }{code}
It's not the Clients Fault (which is, what the 4xx-Status-Range is meant for) - 
i changed this one into a {{SERVICE_UNAVAILABLE}}, which reflects the behavior 
more correct imho.

Let me know if these are okay for you, then i'll go ahead and commit this one
                
> Migrate enable/disable Ping from JSP to PingRequestHandler
> ----------------------------------------------------------
>
>                 Key: SOLR-3301
>                 URL: https://issues.apache.org/jira/browse/SOLR-3301
>             Project: Solr
>          Issue Type: Improvement
>          Components: web gui
>    Affects Versions: 4.0
>            Reporter: Eric Pugh
>            Assignee: Stefan Matheis (steffkes)
>             Fix For: 4.0
>
>         Attachments: PingRequestHandlerTest.java, SOLR-3301.patch, 
> health_check_admin_consolidate.patch, health_check_admin_consolidate2.patch, 
> healthcheck-ui.png, healthcheckenable.patch, ping_request_handler.patch
>
>
> My colleague @omnifroodle and I noticed that you can't enable/disable pings 
> in 4.0 because action.jsp doesn't run.  This patch attaches the functionality 
> to the PingRequestHandler.  We debated creating a new 
> HealthcheckRequestHandler as well.   We added some basic unit tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to