-
Notifications
You must be signed in to change notification settings - Fork 25.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a real out of memory error in die with dignity #77039
Use a real out of memory error in die with dignity #77039
Conversation
Today when testing dying with dignity, we simply throw an OutOfMemoryError. We know this should not get caught by any intermediate code and end up in the uncaught exception handler. This allows us to test that this exception handler is able to successfully kill the VM. However, it is on the table to no longer use the uncaught exception handler, but instead the built-in support for ExitOnOutOfMemoryError. A fake OutOfMemoryError would not be processed by this handler, so to prepare the way, we switch to using a real OutOfMemoryError.
Pinging @elastic/es-core-infra (Team:Core/Infra) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM2, thanks Jason!
@@ -62,7 +62,7 @@ public void testDieWithDignity() throws Exception { | |||
".*ElasticsearchUncaughtExceptionHandler.*", | |||
".*javaRestTest-0.*", | |||
".*fatal error in thread \\[Thread-\\d+\\], exiting.*", | |||
".*java.lang.OutOfMemoryError: die with dignity.*" | |||
".*java.lang.OutOfMemoryError: Requested array size exceeds VM limit.*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This leaks jvm implementation into our tests. I am not really against that, but perhaps we can add a comment to remove the text from matching if it fails?
…th-dignity-actual-oom
Today when testing dying with dignity, we simply throw an OutOfMemoryError. We know this should not get caught by any intermediate code and end up in the uncaught exception handler. This allows us to test that this exception handler is able to successfully kill the VM. However, it is on the table to no longer use the uncaught exception handler, but instead the built-in support for ExitOnOutOfMemoryError. A fake OutOfMemoryError would not be processed by this handler, so to prepare the way, we switch to using a real OutOfMemoryError.
Today when testing dying with dignity, we simply throw an
OutOfMemoryError
. We know this should not get caught by any intermediate code and end up in the uncaught exception handler. This allows us to test that this exception handler is able to successfully kill the VM. However, it is on the table to no longer use the uncaught exception handler, but instead the built-in support forExitOnOutOfMemoryError
. A fakeOutOfMemoryError
would not be processed by this handler, so to prepare the way, we switch to using a realOutOfMemoryError
.Relates #71542