You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2015/01/13 16:27:37 UTC
svn commit: r1651381 - in /lucene/dev/branches/branch_5x: ./ solr/
solr/CHANGES.txt solr/core/
solr/core/src/java/org/apache/solr/cloud/DistributedQueue.java
Author: markrmiller
Date: Tue Jan 13 15:27:36 2015
New Revision: 1651381
URL: http://svn.apache.org/r1651381
Log:
SOLR-6941: DistributedQueue#containsTaskWithRequestId can fail with NPE.
Modified:
lucene/dev/branches/branch_5x/ (props changed)
lucene/dev/branches/branch_5x/solr/ (props changed)
lucene/dev/branches/branch_5x/solr/CHANGES.txt (contents, props changed)
lucene/dev/branches/branch_5x/solr/core/ (props changed)
lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/DistributedQueue.java
Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1651381&r1=1651380&r2=1651381&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Tue Jan 13 15:27:36 2015
@@ -393,6 +393,8 @@ Bug Fixes
* SOLR-6923: AutoAddReplicas also consults live_nodes to see if a state change has happened.
(Varun Thacker via Anshum Gupta)
+* SOLR-6941: DistributedQueue#containsTaskWithRequestId can fail with NPE. (Mark Miller)
+
Optimizations
----------------------
Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/DistributedQueue.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/DistributedQueue.java?rev=1651381&r1=1651380&r2=1651381&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/DistributedQueue.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/DistributedQueue.java Tue Jan 13 15:27:36 2015
@@ -122,10 +122,13 @@ public class DistributedQueue {
for (String childName : childNames) {
if (childName != null) {
try {
- ZkNodeProps message = ZkNodeProps.load(zookeeper.getData(dir + "/" + childName, null, null, true));
- if (message.containsKey(OverseerCollectionProcessor.ASYNC)) {
- LOG.info(">>>> {}", message.get(OverseerCollectionProcessor.ASYNC));
- if(message.get(OverseerCollectionProcessor.ASYNC).equals(requestId)) return true;
+ byte[] data = zookeeper.getData(dir + "/" + childName, null, null, true);
+ if (data != null) {
+ ZkNodeProps message = ZkNodeProps.load(data);
+ if (message.containsKey(OverseerCollectionProcessor.ASYNC)) {
+ LOG.debug(">>>> {}", message.get(OverseerCollectionProcessor.ASYNC));
+ if(message.get(OverseerCollectionProcessor.ASYNC).equals(requestId)) return true;
+ }
}
} catch (KeeperException.NoNodeException e) {
// Another client removed the node first, try next