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

   ### What changes were proposed in this pull request?
   This PR makes Hive client classloader cleanup deterministic when Hive client 
pools are closed.
   
   - Override `HiveClientPool#close()` to call `super.close()` and then always 
close `HiveClientFactory` in `finally`.
   - Add `TestHiveClientPool` assertion to verify factory-close path is invoked.
   - Add `dev/ci/hive_catalog_oom_repro.sh` stress script to repeatedly create 
schema/table, load table, and drop catalog for long-run metaspace/OOM 
reproduction.
   
   ### Why are the changes needed?
   `HiveClientFactory` owns `backendClassLoader` (`HiveClientClassLoader`) and 
only closes it in `HiveClientFactory#close()`.
   Previously, `HiveClientPool` only closed pooled `HiveClient` instances, so 
the factory close path could be skipped, making classloader cleanup depend on 
GC timing and causing classloader accumulation under long-running churn.
   
   Fix: #10844
   
   ### Does this PR introduce _any_ user-facing change?
   No API changes.
   A new internal CI/dev stress script is added for reproduction and 
verification.
   
   ### How was this patch tested?
   - `./gradlew :catalogs:hive-metastore-common:test --tests 
org.apache.gravitino.hive.TestHiveClientPool --no-daemon`
   - `bash -n dev/ci/hive_catalog_oom_repro.sh`
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to