exist
exist copied to clipboard
[BUG] Embedded Exist-DB clears ThreadLocals unrelated to Exist on shutdown
The Memory-Leak fix ThreadLocal for all threads will be cleared up on shutdown clears all ThreadLocals of the whole JVM even if they are not owned/created by exist. When using embedded exist-db in e.g integration testing this leads to a changed system state if the db is shutdown before the end of the test and ThreadLocals are used by the system under test or the testing harness. Our current solution is to snapshot relevant ThreadLocals and restore them after completing the db.shutdown(). But maybe the current implementation could be extended to filter/skip "external" ThreadLocals.
This issue was encountered with eXist-db 6.3.0