orientechnologies / orientdb

OrientDB is the most versatile DBMS supporting Graph, Document, Reactive, Full-Text and Geospatial models in one Multi-Model product. OrientDB can run distributed (Multi-Master), supports SQL, ACID Transactions, Full-Text indexing and Reactive Queries.
https://orientdb.dev
Apache License 2.0
4.73k stars 870 forks source link

Orient Db 3.2.0 embedded locks when shutting down, and leaks threadlocal keys #9605

Open jamieb22 opened 3 years ago

jamieb22 commented 3 years ago

OrientDB Version: 3.2.0 GA

Java Version: 8

OS: Linux

Expected behavior

Orient DB embedded shutdown cleanly without any leaks

Actual behavior

Orient locks, doesn't allow app to shutdown and Tomcat reports Threadlocal leaks.

11-May-2021 17:30:17.995 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7d4082a0]) and a value of type [com.orientechnologies.common.concur.lock.ScalableRWLock.ReadersEntry] (value [com.orientechnologies.common.concur.lock.ScalableRWLock$ReadersEntry@1fd4c1c6]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

Steps to reproduce

<An SQL script to reproduce the problem or a JUnit test case will increase A LOT the chance to have a quick fix>

jacquipre commented 2 years ago

Hi, is there any chance that this will be fixed soon (since there are two more issues with a similar reason #9647 and #9563 )? Or can you provide a workaround?

Regards, jacquipre