-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Hello,
Need your advice. In my application, I make a simple health check for a listener container.
protected void doHealthCheck(Health.Builder builder) {
for (MessageListenerContainer container : listenerRegistry.getListenerContainers()) {
if (!container.isRunning()) {
builder.down();
return;
}
}
builder.up();
}
But it doesn't work as expected, because if a listener thread throws an error exception like OutOfMemoryException (Type: Error), the exception isn't caught and the thread dies. The running flag would be true for a dead container.
Line 714 in 7b214f8
while (isRunning()) { |
I made a workaround, like -XX:+CrashOnOutOfMemoryError -XX:+ExitOnOutOfMemoryError.
I understand that catching a throwable is a bad practice, but could you catch it and change the flag?:)