Closed lsingal closed 3 years ago
Unfortunately, I don't think there is anything lz4-java can do for the leftover .so files caused by JVM crashes. At the loading time, lz4-java deletes any leftover .so files that are not accompanied by a corresponding .so.lck file. This logic is to handle the case #132. However, in case of a crash, both the .so and .so.lck files will be left behind, won't they? lz4-java cannot delete such a .so file, because it might be being used by another lz4-java running in another JVM.
Well, strictly speaking, if we assume the UNIX semantics of the file system, we might be able to delete such a .so file without affecting the process using it, but I don't think we can generalize it to all the systems JVM supports. Also, there would be a nasty race condition between the two JVMs using lz4-java.
The reason lz4-java uses the system-provided temporary directory to store the .so file is to tolerate cases like this. Even if there are leftover .so files in the temporary directory, they should not affect the other parts of the system.
Would you need any further clarification or have any suggestion?
Feel free to reopen this if you need further help.
We noticed an issue in our linux platform where we are not cleaning up the lib files after jvm crashes. I see that you made a fix to delete the lock files. Do you have plan to add functionality to delete the leftover
*.so
files.