Repository navigation
ARROW-17794: [Java] Force delete jni lib file on JVM exit - #14189
Conversation
|
|
| import java.util.List; | ||
| import java.util.Set; | ||
|
|
||
| import org.apache.commons.io.FileUtils; |
There was a problem hiding this comment.
Is not needed to add commons-io as a Dataset module dependency?
There was a problem hiding this comment.
Thanks for your attension, I have change the way to delete file. No need to use FileUtils as it is a file.
| final String libraryToLoad = System.mapLibraryName(name); | ||
| try { | ||
| File temp = File.createTempFile("jnilib-", ".tmp", new File(System.getProperty("java.io.tmpdir"))); | ||
| temp.deleteOnExit(); |
There was a problem hiding this comment.
Test: mvn -Darrow.cpp.build.dir=/Users/arrow/lib -Dtest="TestFileSystemDataset#testBaseOrcRead" clean test
Before the changes:
- target/jnilib-11079005003293013490.tmp
- target/jnilib-9915730910284592509.tmp
After the changes (1 tmp was deleted):
- target/jnilib-9915730910284592509.tmp
Could be possible to force delete also the another JNI file created?
There was a problem hiding this comment.
Sure, I can check and resolve this.
There was a problem hiding this comment.
Thank for your double check. I have remove the extra lib file and checked it in my environment.
There was a problem hiding this comment.
Awesome, thank you a lot
|
Benchmark runs are scheduled for baseline = be30611 and contender = 67f5ac8. 67f5ac8 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
|
@github-actions crossbow submit java-jars |
|
Revision: a0a821f Submitted crossbow builds: ursacomputing/crossbow @ actions-727dfc5f94
|
Use `File.deleteOnExit` to delete jni lib file on JVM exit. `File.deleteOnExit` actually add a shut down hook to make sure file delte. Authored-by: jackylee-ch <[email protected]> Signed-off-by: David Li <[email protected]>
Use `File.deleteOnExit` to delete jni lib file on JVM exit. `File.deleteOnExit` actually add a shut down hook to make sure file delte. Authored-by: jackylee-ch <[email protected]> Signed-off-by: David Li <[email protected]>
Use
File.deleteOnExitto delete jni lib file on JVM exit.File.deleteOnExitactually add a shut down hook to make sure file delte.