Skip to content

Conversation

@teamconfx
Copy link

This PR fix 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:

  if (tasks.isEmpty())

To:

  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

@teamconfx teamconfx force-pushed the fix-cassandra-21128 branch from 33f7881 to eef6cd7 Compare January 23, 2026 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant