You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "yuqi1129 (via GitHub)" <gi...@apache.org> on 2026/06/26 12:19:54 UTC

[PR] [#11810] fix(core): treat authorization plugin classes as isolated in IsolatedClassLoader [gravitino]

yuqi1129 opened a new pull request, #11811:
URL: https://github.com/apache/gravitino/pull/11811

   ### What changes were proposed in this pull request?
   
   Add the authorization plugin packages `org.apache.gravitino.authorization.{ranger,chain,jdbc,common}.` to `IsolatedClassLoader.isCatalogClass()` so these plugin classes are loaded by the isolated classloader instead of being delegated to the server classloader. The bare `org.apache.gravitino.authorization.*` prefix is intentionally left out so server-side classes (e.g. `RoleManager`, `AuthorizationUtils`) remain shared.
   
   Tests: add `TestIsolatedClassLoader.testAuthorizationPluginPackagesRecognizedAsCatalogClass` and extend the negative test to assert server-side authorization classes stay shared.
   
   ### Why are the changes needed?
   
   Authorization plugin classes were classified as *shared* and delegated to the server classloader. Under certain classloader-initialization timing windows the server classloader becomes the defining classloader of a plugin class (e.g. `RangerPrivileges`), and its nested/synthetic classes (e.g. the inner enum `RangerPrivileges$RangerHdfsPrivilege`) cannot be resolved from the server classpath. The JVM permanently caches this load failure for the lifetime of the process, so every subsequent role/authorization operation throws `NoClassDefFoundError` until restart. This surfaces intermittently in `RangerHiveE2EIT`.
   
   This is the same class of bug as #11704 (fixed for the hive packages in #11705), now applied to the authorization plugins.
   
   Fix: #11810
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. This is an internal classloader fix with no API or behavior change.
   
   ### How was this patch tested?
   
   `./gradlew :core:test --tests "org.apache.gravitino.utils.TestIsolatedClassLoader"` — passes (4 test methods, including the new authorization-plugin coverage and the server-side-stays-shared assertions).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#11810] fix(core): treat authorization plugin classes as isolated in IsolatedClassLoader [gravitino]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #11811:
URL: https://github.com/apache/gravitino/pull/11811#issuecomment-4810066947

   <!-- coverage-report -->
   ### Code Coverage Report
   |Overall Project|67.24% **`-0.01%`**|:green_circle:|
   |:-|:-|:-:|
   |Files changed|57.84%|:red_circle:|
   <br>
   
   |Module|Coverage||
   |:-|:-|:-:|
   |aliyun|1.72%|:red_circle:|
   |api|46.82%|:green_circle:|
   |authorization-common|85.96%|:green_circle:|
   |aws|26.5%|:red_circle:|
   |azure|2.47%|:red_circle:|
   |catalog-common|10.4%|:red_circle:|
   |catalog-fileset|80.23%|:green_circle:|
   |catalog-glue|66.91%|:green_circle:|
   |catalog-hive|79.42%|:green_circle:|
   |catalog-jdbc-clickhouse|80.02%|:green_circle:|
   |catalog-jdbc-common|44.22%|:green_circle:|
   |catalog-jdbc-doris|80.28%|:green_circle:|
   |catalog-jdbc-hologres|54.03%|:green_circle:|
   |catalog-jdbc-mysql|79.23%|:green_circle:|
   |catalog-jdbc-oceanbase|80.91%|:green_circle:|
   |catalog-jdbc-postgresql|82.29%|:green_circle:|
   |catalog-jdbc-starrocks|78.51%|:green_circle:|
   |catalog-kafka|77.01%|:green_circle:|
   |catalog-lakehouse-generic|58.53%|:green_circle:|
   |catalog-lakehouse-hudi|79.1%|:green_circle:|
   |catalog-lakehouse-iceberg|85.86%|:green_circle:|
   |catalog-lakehouse-paimon|82.14%|:green_circle:|
   |catalog-model|77.72%|:green_circle:|
   |cli|44.51%|:green_circle:|
   |client-java|78.01%|:green_circle:|
   |common|50.17%|:green_circle:|
   |core|82.59% **`-0.1%`**|:green_circle:|
   |filesystem-hadoop3|77.27%|:green_circle:|
   |flink|0.0%|:red_circle:|
   |flink-common|47.12%|:green_circle:|
   |flink-runtime|0.0%|:red_circle:|
   |gcp|14.12%|:red_circle:|
   |hadoop-common|10.88%|:red_circle:|
   |hive-metastore-common|53.77%|:green_circle:|
   |iceberg-common|58.15%|:green_circle:|
   |iceberg-rest-server|73.98%|:green_circle:|
   |idp-basic|85.71%|:green_circle:|
   |integration-test-common|0.0%|:red_circle:|
   |jobs|66.17%|:green_circle:|
   |lance-common|20.83%|:red_circle:|
   |lance-rest-server|60.13%|:green_circle:|
   |lineage|53.02%|:green_circle:|
   |optimizer|82.87%|:green_circle:|
   |optimizer-api|21.95%|:red_circle:|
   |server|86.09%|:green_circle:|
   |server-common|74.18%|:green_circle:|
   |spark|28.57%|:red_circle:|
   |spark-common|41.66%|:green_circle:|
   |trino-connector|40.29%|:green_circle:|
   
   <details>
   <summary>Files</summary>
   
   |Module|File|Coverage||
   |:-|:-|:-|:-:|
   |core|[IsolatedClassLoader.java](https://github.com/yuqi1129/gravitino/blob/4fc34df319b47951ddf67a65158219b2b2dd4477/core/src/main/java/org/apache/gravitino/utils/IsolatedClassLoader.java)|57.84%|:red_circle:|
   
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#11810] fix(core): treat authorization plugin classes as isolated in IsolatedClassLoader [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on PR #11811:
URL: https://github.com/apache/gravitino/pull/11811#issuecomment-4809888348

   Closing: this was based on an incorrect hypothesis. The `RangerPrivileges` NoClassDefFoundError is not caused by an `isCatalogClass()` whitelist gap. Root cause is elsewhere (the entity-change-log poller invalidating an in-use catalog and hard-closing its IsolatedClassLoader), so this change does not fix the issue. Will track the real fix separately.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#11810] fix(core): treat authorization plugin classes as isolated in IsolatedClassLoader [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 closed pull request #11811: [#11810] fix(core): treat authorization plugin classes as isolated in IsolatedClassLoader
URL: https://github.com/apache/gravitino/pull/11811


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org