Shanzita opened a new pull request, #4691:
URL: https://github.com/apache/cassandra/pull/4691
**Description**:
CASSANDRA-16939: Only remove shutdown hook for fatal heap
OOMs
Previously, `StorageService.removeShutdownHook()` was
called unconditionally
for all `OutOfMemoryError`s in
`JVMStabilityInspector.inspectThrowable()`.
This removed the drain shutdown hook even for non-fatal
OOMs like
"Direct buffer memory" or "unable to create new native
thread", preventing
graceful shutdown afterward even though the JVM was
otherwise healthy.
The fix guards `removeShutdownHook()` with a new
`isHeapSpaceOom()` method
that reuses the existing `FORCE_HEAP_OOM_IGNORE_SET` to
only remove the hook
for fatal heap OOMs ("Java heap space", "GC Overhead limit
exceeded").
**Changes:**
- `JVMStabilityInspector.java`: Guard
`removeShutdownHook()` with `isHeapSpaceOom()` check
- `JVMStabilityInspectorTest.java`: Added tests verifying
shutdown hook is preserved
for non-fatal OOMs and removed for fatal OOMs
**Tests:**
- All existing tests pass (8/8, 0 failures)
- Checkstyle clean (0 violations)
patch by Shanizta Siddiqua; reviewed by <Reviewers> for
CASSANDRA-16939
--
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]