[
https://issues.apache.org/jira/browse/SOLR-8254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14996313#comment-14996313
]
Alan Woodward commented on SOLR-8254:
-------------------------------------
Lines 781-794:
{code}
//Hitting the leaders is useful when it's an update request.
//For queries it doesn't matter and hence we don't distinguish here.
for (Map.Entry<String, Slice> entry : entries) {
// first see if we have the leader
Replica leaderProps = clusterState.getLeader(collection, entry.getKey());
// <----- CAN RETURN NULL IF THERE'S NO LEADER
if (liveNodes.contains(leaderProps.getNodeName()) &&
leaderProps.getState() == Replica.State.ACTIVE) {
if (leaderProps != null) {
core = checkProps(leaderProps);
}
if (core != null) {
return core;
}
}
{code}
The leaderProps null check should be part of the outer if statement, I think,
but I don't grok this bit of code well enough to know what to do if the leader
is in fact null.
It also strikes me that this method probably belongs on CoreContainer, rather
than as a private method in HttpSolrCall?
> HttpSolrCall.getCoreByCollection can throw NPE if there are no leaders up
> -------------------------------------------------------------------------
>
> Key: SOLR-8254
> URL: https://issues.apache.org/jira/browse/SOLR-8254
> Project: Solr
> Issue Type: Bug
> Reporter: Alan Woodward
>
> See http://jenkins.thetaphi.de/job/Lucene-Solr-5.x-Windows/5254/
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]