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

[I] [Improvement] Ensure all Capability method calls are made within the correct classloader context [gravitino]

JoegenUSTC opened a new issue, #11726:
URL: https://github.com/apache/gravitino/issues/11726

   ### What would you like to be improved?
   
   ## Background
   
   PR #11707 fixed an intermittent `NoClassDefFoundError` caused by
   `HiveCatalogCapability.caseSensitiveOnName()` being called outside the
   `IsolatedClassLoader.withClassLoader()` boundary. The fix worked around the
   issue by removing the compiler-generated synthetic `$1` class.
   
   However, as noted in the PR review, this is a workaround rather than a root fix.
   
   ## Root Cause
   
   `CatalogWrapper.capabilities()` returns a `Capability` object loaded by the
   catalog's isolated classloader. This object is then used **outside** the
   `withClassLoader()` boundary (e.g., in `SchemaNormalizeDispatcher`). Any
   `Capability` method implementation that references plugin-jar classes will
   trigger a classloader mismatch, causing the JVM to permanently cache a
   `NoClassDefFoundError` for the process lifetime.
   
   ## Scope of Impact
   
   Any catalog that implements `Capability` methods referencing classes from the
   plugin jar (e.g., using `switch-on-enum`, or calling plugin-internal types)
   is potentially affected. This is not limited to the Hive catalog.
   
   ## Expected Fix
   
   All calls to `Capability` methods should be made within the correct classloader
   context, either by:
   1. Wrapping `capabilities()` call sites with `withClassLoader()`, or
   2. Ensuring `CatalogWrapper` proxies `Capability` method calls through the
      isolated classloader automatically.
   
   ## References
   
   - PR: #11707
   - Related: `CatalogWrapper.capabilities()`, `SchemaNormalizeDispatcher`,
     `IsolatedClassLoader.withClassLoader()`
   
   ### How should we improve?
   
   _No response_


-- 
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.apache.org

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


Re: [I] [Improvement] Ensure all Capability method calls are made within the correct classloader context [gravitino]

Posted by "yuqi1129 (via GitHub) via commits" <co...@gravitino.apache.org>.
yuqi1129 closed issue #11726: [Improvement] Ensure all Capability method calls are made within the correct classloader context
URL: https://github.com/apache/gravitino/issues/11726


-- 
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