You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by jefferyyuan <gi...@git.apache.org> on 2018/06/11 20:24:34 UTC

[GitHub] lucene-solr pull request #402: SOLR-12477 - Return server error(500) for Alr...

GitHub user jefferyyuan opened a pull request:

    https://github.com/apache/lucene-solr/pull/402

    SOLR-12477 - Return server error(500) for AlreadyClosedException instead of client Errors(400)

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jefferyyuan/lucene-solr master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/lucene-solr/pull/402.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #402
    
----
commit 5a9ceb63511de3fd3452f6b0cc65cc41dc5ae6e9
Author: yyuan2 <yy...@...>
Date:   2018-06-11T20:22:14Z

    SOLR-12477 - Return server error(500) for AlreadyClosedException instead of client Errors(400)

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[GitHub] lucene-solr pull request #402: SOLR-12477 - Return server error(500) for Alr...

Posted by jefferyyuan <gi...@git.apache.org>.
Github user jefferyyuan closed the pull request at:

    https://github.com/apache/lucene-solr/pull/402


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[GitHub] lucene-solr pull request #402: SOLR-12477 - Return server error(500) for Alr...

Posted by jefferyyuan <gi...@git.apache.org>.
Github user jefferyyuan commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/402#discussion_r205932118
  
    --- Diff: solr/core/src/java/org/apache/solr/handler/RequestHandlerBase.java ---
    @@ -208,14 +208,17 @@ public void handleRequest(SolrQueryRequest req, SolrQueryResponse rsp) {
             }
           }
         } catch (Exception e) {
    +      boolean hasTragicException = false;
    --- End diff --
    
    @vthacker 
    Changed the code as you suggested, and like you variable name: isTragic :)
    I checked the code is one of 500 or 404 in LeaderTragicEventTest.java for update or commit:
    ```java
       assertThat(se.code(), anyOf(is(500), is(404)));
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[GitHub] lucene-solr pull request #402: SOLR-12477 - Return server error(500) for Alr...

Posted by vthacker <gi...@git.apache.org>.
Github user vthacker commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/402#discussion_r205929654
  
    --- Diff: solr/core/src/java/org/apache/solr/handler/RequestHandlerBase.java ---
    @@ -208,14 +208,17 @@ public void handleRequest(SolrQueryRequest req, SolrQueryResponse rsp) {
             }
           }
         } catch (Exception e) {
    +      boolean hasTragicException = false;
    --- End diff --
    
    Here is what I was thinking of after this statement. What do you think?
    
            if (isTragic) {
              if (e instanceof SolrException) {
                assert ((SolrException) e).code() == 500; //Tragic exceptions should always throw a server error
              } else {
                //wrap it in a solr exception
                e = new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
              }
            }


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[GitHub] lucene-solr issue #402: SOLR-12477 - Return server error(500) for AlreadyClo...

Posted by jefferyyuan <gi...@git.apache.org>.
Github user jefferyyuan commented on the issue:

    https://github.com/apache/lucene-solr/pull/402
  
    Close this as @vthacker has submitted this in https://issues.apache.org/jira/browse/SOLR-12477 :)
    - (cherry picked from commit 8d28bbc) 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[GitHub] lucene-solr pull request #402: SOLR-12477 - Return server error(500) for Alr...

Posted by vthacker <gi...@git.apache.org>.
Github user vthacker commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/402#discussion_r205929735
  
    --- Diff: solr/core/src/java/org/apache/solr/handler/RequestHandlerBase.java ---
    @@ -208,14 +208,17 @@ public void handleRequest(SolrQueryRequest req, SolrQueryResponse rsp) {
             }
           }
         } catch (Exception e) {
    +      boolean hasTragicException = false;
    --- End diff --
    
    Looking at LeaderTragicEventTest.java maybe we should check if the code is a 500 or a 404 also? 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org