SOLR-1016: HTTP 503 error changes 500 in SolrCore

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@743228 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Koji Sekiguchi 2009-02-11 05:14:11 +00:00
parent 3e75ec8dae
commit 22c110c5ba
2 changed files with 12 additions and 2 deletions

View File

@ -256,6 +256,8 @@ Bug Fixes
<query>office:Bridgewater</query><query>office:Osaka</query>
</delete>
30. SOLR-1016: HTTP 503 error changes 500 in SolrCore (koji)
Other Changes
----------------------

View File

@ -1361,9 +1361,17 @@ public final class SolrCore implements SolrInfoMBean {
// TODO should check that responseHeader has not been replaced by handler
NamedList responseHeader = rsp.getResponseHeader();
final int qtime=(int)(rsp.getEndTime() - req.getStartTime());
responseHeader.add("status",rsp.getException()==null ? 0 : 500);
int status = 0;
Exception exception = rsp.getException();
if( exception != null ){
if( exception instanceof SolrException )
status = ((SolrException)exception).code();
else
status = 500;
}
responseHeader.add("status",status);
responseHeader.add("QTime",qtime);
rsp.getToLog().add("status",rsp.getException()==null ? 0 : 500);
rsp.getToLog().add("status",status);
rsp.getToLog().add("QTime",qtime);
SolrParams params = req.getParams();