[ 
https://issues.apache.org/jira/browse/HADOOP-8756?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Colin Patrick McCabe updated HADOOP-8756:
-----------------------------------------

    Description: 
We use {{System.loadLibrary("snappy")}} from the Java side.  However in 
libhadoop, we use {{dlopen}} to open libsnappy.so dynamically.  
System.loadLibrary uses {{java.library.path}} to resolve libraries, and 
{{dlopen}} uses {{LD_LIBRARY_PATH}} and the system paths to resolve libraries.  
Because of this, the two library loading functions can be at odds.

We should fix this so we only load the library once, preferably using the 
standard Java {{java.library.path}}.

We should also log the search path(s) we use for {{libsnappy.so}} when loading 
fails, so that it's easier to diagnose configuration issues.

  was:
* We use {{System.loadLibrary("snappy")}} from the Java side.  However in 
libhadoop, we use {{dlopen}} to open libsnappy.so dynamically.  It seems like 
the System.loadLibrary nonsense is completely redundant-- we would only need 
this if we planned on accessing libsnappy methods directly from Java (via the 
'native' keyword)- - which we don't, and can't, since snappy is not JNI.  At 
the end of the day, snappy is only accessible through libhadoop.so, so I think 
snappy-related issues should be handled there.

* We should log the search path(s) we use for {{libsnappy.so}}, so that it's 
easier to diagnose configuration issues.

    
> libsnappy loader issues
> -----------------------
>
>                 Key: HADOOP-8756
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8756
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: native
>    Affects Versions: 2.2.0-alpha
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>            Priority: Minor
>
> We use {{System.loadLibrary("snappy")}} from the Java side.  However in 
> libhadoop, we use {{dlopen}} to open libsnappy.so dynamically.  
> System.loadLibrary uses {{java.library.path}} to resolve libraries, and 
> {{dlopen}} uses {{LD_LIBRARY_PATH}} and the system paths to resolve 
> libraries.  Because of this, the two library loading functions can be at odds.
> We should fix this so we only load the library once, preferably using the 
> standard Java {{java.library.path}}.
> We should also log the search path(s) we use for {{libsnappy.so}} when 
> loading fails, so that it's easier to diagnose configuration issues.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to