Skip to content

Conversation

@ArafatKhan2198
Copy link
Contributor

What changes were proposed in this pull request?

The test testKeyCountsForValidAndInvalidKeyPrefix sometimes fails with "Rocks Database is closed" when trying to clear a database table.
Why it happens:
The test creates a new database before each test run.
It immediately tries to clear a table.
Sometimes the database isn’t fully ready yet, or it gets closed during setup.
The code that clears the table doesn’t handle a closed database, so it crashes.
The fix:
Updated the clear-table code to detect a closed database.
If the database is closed, log a warning and skip clearing (instead of crashing).
Still throw other errors so real problems aren’t hidden.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14210

How was this patch tested?

@ArafatKhan2198 ArafatKhan2198 marked this pull request as ready for review January 13, 2026 08:41
Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ArafatKhan2198 for working on this. If it's a test problem, please fix it in the test. We should not ignore closed database globally.

@ArafatKhan2198 ArafatKhan2198 marked this pull request as draft January 13, 2026 09:10
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.

2 participants