andygrove commented on code in PR #1000:
URL: https://github.com/apache/datafusion-comet/pull/1000#discussion_r1810909644


##########
common/src/main/java/org/apache/comet/NativeBase.java:
##########
@@ -46,15 +46,24 @@ public abstract class NativeBase {
 
   private static final String libraryToLoad = 
System.mapLibraryName(NATIVE_LIB_NAME);
   private static boolean loaded = false;
+  private static Throwable loadErr = null;
   private static final String searchPattern = "libcomet-";
 
   static {
-    if (!isLoaded()) {
+    try {
       load();
+    } catch (Throwable th) {
+      LOG.warn("Failed to load comet library", th);
+      // logging may not be initialized yet, so also write to stderr
+      System.err.println("Failed to load comet library: " + th.getMessage());
+      loadErr = th;
     }
   }
 
-  public static synchronized boolean isLoaded() {
+  public static synchronized boolean isLoaded() throws Throwable {

Review Comment:
   This is called from `isCometEnabled` and we already had error handling here 
which could never be triggered due to `isLoaded` never being capable of 
throwing an exception.



-- 
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]

Reply via email to