Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-5408

RocksDB initialization can fail with an UnsatisfiedLinkError in the presence of multiple classloaders

    XMLWordPrintableJSON

Details

    Description

      When the RocksDB is loaded from different ClassLoaders (for example because it is in the user code jar, or loaded dynamically in tests) it may fail with an "java.lang.UnsatisfiedLinkError: Native Library /path/to/temp/dir/librocksdbjni-linux64.so already loaded in another classloader.

      Apparently the JVM can handle multiple instances of the same JNI library being loaded in different class loaders, but not when coming from the same file path.

      This affects only version 1.2 onward, because from there we extract the JNI library into Flink's temp folders to make sure that it gets cleaned up for example by YARN when the application finishes. When giving a parent directory, RocksDB does not add a unique number sequence to the temp file name.

      Attachments

        Issue Links

          Activity

            People

              sewen Stephan Ewen
              sewen Stephan Ewen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: