Skip to content

Use a real out of memory error in die with dignity#77039

Merged
jasontedor merged 4 commits intoelastic:masterfrom
jasontedor:die-with-dignity-actual-oom
Sep 1, 2021
Merged

Use a real out of memory error in die with dignity#77039
jasontedor merged 4 commits intoelastic:masterfrom
jasontedor:die-with-dignity-actual-oom

Conversation

@jasontedor
Copy link
Copy Markdown
Member

@jasontedor jasontedor commented Aug 30, 2021

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.

Relates #71542

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.
@jasontedor jasontedor added :Core/Infra/Core Core issues without another label v8.0.0 v7.16.0 labels Aug 30, 2021
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Aug 30, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Copy Markdown
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@henningandersen henningandersen left a comment

Choose a reason for hiding this comment

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

LGTM2, thanks Jason!

".*javaRestTest-0.*",
".*fatal error in thread \\[Thread-\\d+\\], exiting.*",
".*java.lang.OutOfMemoryError: die with dignity.*"
".*java.lang.OutOfMemoryError: Requested array size exceeds VM limit.*"
Copy link
Copy Markdown
Contributor

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?

@jasontedor jasontedor merged commit 3c589ef into elastic:master Sep 1, 2021
jasontedor added a commit that referenced this pull request Sep 1, 2021
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.
@jasontedor jasontedor deleted the die-with-dignity-actual-oom branch September 1, 2021 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Core Core issues without another label >non-issue Team:Core/Infra Meta label for core/infra team v7.16.0 v8.0.0-alpha2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants