adoroszlai opened a new pull request, #7493: URL: https://github.com/apache/ozone/pull/7493
## What changes were proposed in this pull request? `NativeLibraryLoader` copies the library being loaded to the directory defined by `native.lib.tmp.dir` property (e.g. `/tmp`). It uses a temporary file name as target to avoid conflicts. It also copies some dependencies, whose names are preserved to ensure library links are not broken. All libs are deleted when the process exits. Multiple Ozone processes running on the same host all copy libs to the same path (`/tmp/librocksdbjni-linux64.so`). Copying and deleting both introduce race conditions, causing other processes to see incomplete or no file at all. https://issues.apache.org/jira/browse/HDDS-11811 ## How was this patch tested? Updated unit test case. ``` [INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.633 s - in org.apache.hadoop.hdds.utils.TestNativeLibraryLoader ``` Built locally with native libs. ``` $ mvn -DskipTests -DskipRecon -Drocks_tools_native clean package ``` ``` $ cd hadoop-ozone/dist/target/ozone-2.0.0-SNAPSHOT $ bin/ozone checknative Native library checking: hadoop: false ISA-L: false rocks-tools: true libozone_rocksdb_tools.so $ export OZONE_OPTS=-Dnative.lib.tmp.dir=/no-such-dir $ bin/ozone checknative Native library checking: hadoop: false ISA-L: false rocks-tools: false ``` CI: https://github.com/adoroszlai/ozone/actions/runs/12039265661 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
