Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.15.0
-
None
-
None
Description
When using JDO, we create a thread local RawStore (ObjectStore) object in each metastore thread. This leads to creation of a new JDOPersistenceManager per thread which are cached in JDOPersistanceManagerFactory. To remove JDOPersistenceManager from JDOPersistanceManagerFactory, an explicit JDOPersistenceManager.close needs to be called.
This is a bad candidate for thread local as the effective object destruction requires the application to call close. So, when metastore threads are killed by the threadpool, this object will never be removed from the JDOPersistanceManagerFactory cache.
We fixed this for HiveServer2 using embedded metastore (HIVE-7353) by customizing the GC collection of the dying thread, but I believe a better and more efficient solution is to pool JDOPersistenceManager objects and let each thread get an object for its use from the pool.