dcapwell commented on code in PR #2660:
URL: https://github.com/apache/cassandra/pull/2660#discussion_r1322177990


##########
test/unit/org/apache/cassandra/repair/ValidationTaskTest.java:
##########
@@ -52,10 +52,12 @@ public void shouldIgnoreTreesWhenDeactivated() throws 
Exception
     {
         ValidationTask task = createTask();
         assertTrue(task.isActive());
-        task.abort();
+        task.abort(new RuntimeException());
         assertFalse(task.isActive());
         task.treesReceived(new MerkleTrees(null));
-        assertNull(task.get());
+        // REVIEW: setting null would cause NPEs in sync task, so it was never 
correct to set null
+        assertTrue(task.isDone());
+        assertFalse(task.isSuccess());

Review Comment:
   before, when we abort we didn't resolve the future and had a boolean to 
track that, so if we abort then we would eventually resolve as `null`, which 
doesn't actually stop the repair future chain, so 
`org.apache.cassandra.repair.asymmetric.DifferenceHolder#DifferenceHolder(java.util.List<org.apache.cassandra.repair.TreeResponse>)`
 will get called and NPE at 
   
   ```
   hd.add(r2.endpoint, MerkleTrees.difference(r1.trees, r2.trees));
   ```
   
   Since the job already aborted this will report correctly to ops, but "could" 
get a NPE in the logs



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to