Fix FastJarFS caches cleaning

- add FastJarFS cache cleaning to the daemon implementation, so
the behavior is now the same as for CoreJarFS
- clear not only mappings but also handlers cache: this may result some
slowdown on comparison with the previous cleaning implementation,
but should avoid unreliable behavior on heavy parallel build usages.
This commit is contained in:
Ilya Chernikov
2022-10-28 18:40:26 +02:00
committed by Space Team
parent 82100a414f
commit 23144b92d8
2 changed files with 5 additions and 2 deletions
@@ -51,7 +51,7 @@ class KotlinCoreApplicationEnvironment private constructor(
}
fun idleCleanup() {
fastJarFileSystemField?.cleanOpenFilesCache()
fastJarFileSystemField?.clearHandlersCache()
}
companion object {
@@ -1235,7 +1235,10 @@ class CompileServiceImpl(
override fun clearJarCache() {
ZipHandler.clearFileAccessorCache()
(KotlinCoreEnvironment.applicationEnvironment?.jarFileSystem as? CoreJarFileSystem)?.clearHandlersCache()
KotlinCoreEnvironment.applicationEnvironment?.apply {
(jarFileSystem as? CoreJarFileSystem)?.clearHandlersCache()
idleCleanup()
}
}
private inline fun <R> ifAlive(