Skip to content

Conversation

@jefferyyuan
Copy link

@jefferyyuan jefferyyuan commented Jun 11, 2018

https://issues.apache.org/jira/browse/SOLR-12477

In some cases(for example: corrupt index), addDoc0 throws AlreadyClosedException, but solr server returns client error 400 to client

This will confuse customers and especially monitoring tool.

@jefferyyuan jefferyyuan force-pushed the master branch 4 times, most recently from 7fe62cf to 4503a1f Compare July 21, 2018 00:47
@jefferyyuan jefferyyuan force-pushed the master branch 4 times, most recently from 7723714 to 93a4c26 Compare July 28, 2018 00:25
}
}
} catch (Exception e) {
boolean hasTragicException = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
      }
    }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at LeaderTragicEventTest.java maybe we should check if the code is a 500 or a 404 also?

Copy link
Author

@jefferyyuan jefferyyuan Jul 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vthacker
Changed the code as you suggested, and like you variable name: isTragic :)
I verified the error code of RemoteSolrException is one of 500 or 404 in LeaderTragicEventTest.java for update or commit:

   assertThat(se.code(), anyOf(is(500), is(404)));

@jefferyyuan jefferyyuan force-pushed the master branch 3 times, most recently from 1c37d7a to bcf8931 Compare July 28, 2018 04:28
asfgit pushed a commit that referenced this pull request Jul 31, 2018
asfgit pushed a commit that referenced this pull request Jul 31, 2018
…ad of client Errors(400) . This closes PR #402

(cherry picked from commit 8d28bbc)
@jefferyyuan
Copy link
Author

Close this as @vthacker has submitted this in https://issues.apache.org/jira/browse/SOLR-12477 :)

  • (cherry picked from commit 8d28bbc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants