Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This is related to [#132](https://github.com/lz4/lz4-java/commit/08b3bff3491eafd5238c5adf79113e56f6821e82) #161

Closed
lsingal opened this issue May 14, 2020 · 3 comments

Comments

@lsingal
Copy link

lsingal commented May 14, 2020

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.

@lsingal lsingal changed the title This is related to [#132](https://github.com/lz4/lz4-java/commit/08b3bff3491eafd5238c5adf79113e56f6821e82) This is related to [#132] (https://github.com/lz4/lz4-java/commit/08b3bff3491eafd5238c5adf79113e56f6821e82) May 14, 2020
@lsingal lsingal changed the title This is related to [#132] (https://github.com/lz4/lz4-java/commit/08b3bff3491eafd5238c5adf79113e56f6821e82) This is related to [#132](https://github.com/lz4/lz4-java/commit/08b3bff3491eafd5238c5adf79113e56f6821e82) May 14, 2020
@odaira
Copy link
Member

odaira commented May 14, 2020

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.

@odaira
Copy link
Member

odaira commented Jun 5, 2021

Would you need any further clarification or have any suggestion?

@odaira
Copy link
Member

odaira commented Jul 26, 2021

Feel free to reopen this if you need further help.

@odaira odaira closed this as completed Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants