Skip to content
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

ESIntegTestCase always cleans up static fields (#49105) #49108

Merged

Conversation

jaymode
Copy link
Member

@jaymode jaymode commented Nov 14, 2019

ESIntegTestCase has logic to clean up static fields in a method
annotated with @AfterClass so that these fields do not trigger the
StaticFieldsInvariantRule. However, during the exceptional close of the
test cluster, this cleanup can be missed. The StaticFieldsInvariantRule
always runs and will attempt to inspect the size of the static fields
that were not cleaned up. If the currentCluster field of
ESIntegTestCase references an InternalTestCluster, this could hold a
reference to an implementation of a Path that comes from the
sun.nio.fs package, which the security manager will deny access to.
This casues additional noise to be generated since the
AccessControlException will cause the StaticFieldsInvariantRule to fail
and also be reported along with the actual exception that occurred.

This change clears the static fields of ESIntegTestCase in a finally
block inside the @AfterClass method to prevent this unnecessary noise.

Closes #41526

ESIntegTestCase has logic to clean up static fields in a method
annotated with `@AfterClass` so that these fields do not trigger the
StaticFieldsInvariantRule. However, during the exceptional close of the
test cluster, this cleanup can be missed. The StaticFieldsInvariantRule
always runs and will attempt to inspect the size of the static fields
that were not cleaned up. If the `currentCluster` field of
ESIntegTestCase references an InternalTestCluster, this could hold a
reference to an implementation of a `Path` that comes from the
`sun.nio.fs` package, which the security manager will deny access to.
This casues additional noise to be generated since the
AccessControlException will cause the StaticFieldsInvariantRule to fail
and also be reported along with the actual exception that occurred.

This change clears the static fields of ESIntegTestCase in a finally
block inside the `@AfterClass` method to prevent this unnecessary noise.

Closes elastic#41526
@jaymode jaymode added :Core/Infra/Core Core issues without another label backport labels Nov 14, 2019
@elasticmachine
Copy link
Collaborator

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

@jaymode
Copy link
Member Author

jaymode commented Nov 15, 2019

@elasticmachine run elasticsearch-ci/1

@jaymode jaymode merged commit b6ec066 into elastic:7.x Nov 15, 2019
@jaymode jaymode deleted the ram_usage_estim_access_denied_sun_nio_fs_7x branch November 15, 2019 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport :Core/Infra/Core Core issues without another label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants