teamconfx opened a new pull request, #4578:
URL: https://github.com/apache/cassandra/pull/4578

   This PR fix 
[CASSANDRA-21128](https://issues.apache.org/jira/browse/CASSANDRA-21128).
   
   ### Issue
   
    CompactionManager.submitMaximal() threw a NullPointerException when calling 
tasks.isEmpty() because getMaximalTasks() can return null during node restart 
scenarios (when there are uninterruptible compactions).
   
   ### Fix Applied
   
     File: 
src/java/org/apache/cassandra/db/compaction/CompactionManager.java:1179
   
     Changed:
   ```java
     if (tasks.isEmpty())
   ```
     To:
   ```java
     if (tasks == null || tasks.isEmpty())
   ```
   ###   Test Added
   
     File: 
test/unit/org/apache/cassandra/db/compaction/CompactionManagerSubmitMaximalTest.java
   
     Two test cases:
     1. testSubmitMaximalHandlesNullTasks() - Uses Mockito to simulate 
getMaximalTasks() returning null and verifies the method returns an empty list 
instead of throwing NPE
     2. testSubmitMaximalHandlesEmptyTasks() - Verifies normal behavior with 
empty compaction tasks
   
   


-- 
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