-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
TestCluster hits AccessControlException in *rules.RamUsageEstimator #41526
Comments
Pinging @elastic/es-core-infra |
We discussed this in the core infra meeting. It appears as something is holding onto to a file/filesystem reference in a static field. We do not want to grant this level of access to the RamUsageEstimator. In order to find out what is holding said reference, we need to look at making an improvement in the RamUsageEstimator and/or the test rule to output the class and even the field name when available. |
This may not be needed as RamUsageEstimator already does output the top level object that triggers the exception, but the information is easily overlooked. In the cases of these failures, the RamUsageEstimator output In order to reproduce the issue, I was able to create a test that indexed 1000+ documents asynchronously, then performed a full cluster restart using |
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 unneessary noise. Closes elastic#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 #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 #41526
The JdbcHttpClientRequestTests and HttpClientRequestTests classes both hold a static reference to a mock web server that internally uses the JDKs built-in HttpServer, which resides in a sun package that the RamUsageEstimator does not have access to. This causes builds that use a runtime of Java 8 to fail since the StaticFieldsInvariantRule is run when Java 8 is used. Relates elastic#41526 Relates elastic#49105
The JdbcHttpClientRequestTests and HttpClientRequestTests classes both hold a static reference to a mock web server that internally uses the JDKs built-in HttpServer, which resides in a sun package that the RamUsageEstimator does not have access to. This causes builds that use a runtime of Java 8 to fail since the StaticFieldsInvariantRule is run when Java 8 is used. Relates #41526 Relates #49105
The JdbcHttpClientRequestTests and HttpClientRequestTests classes both hold a static reference to a mock web server that internally uses the JDKs built-in HttpServer, which resides in a sun package that the RamUsageEstimator does not have access to. This causes builds that use a runtime of Java 8 to fail since the StaticFieldsInvariantRule is run when Java 8 is used. Relates #41526 Relates #49105
Builds
https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+7.x+intake/1185/
and
https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+7.x+multijob-darwin-compatibility/127/
Unreproducible:
The text was updated successfully, but these errors were encountered: