aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/java/me
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2021-07-30 18:53:45 +0100
committerLuck <git@lucko.me>2021-07-30 18:53:45 +0100
commit111e52f3347e7ebec7bcca8a1cd185b2900753de (patch)
tree283d0437f73896d4ec25c3128b55a0e455269a05 /spark-common/src/main/java/me
parenta3769a815993a225c428c56870d6446c7ab18741 (diff)
downloadspark-111e52f3347e7ebec7bcca8a1cd185b2900753de.tar.gz
spark-111e52f3347e7ebec7bcca8a1cd185b2900753de.tar.bz2
spark-111e52f3347e7ebec7bcca8a1cd185b2900753de.zip
Catch UnsatisfiedLinkError when loading async-profiler native lib
Diffstat (limited to 'spark-common/src/main/java/me')
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerAccess.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerAccess.java b/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerAccess.java
index 50e97aa..cf9572a 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerAccess.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerAccess.java
@@ -66,7 +66,11 @@ public final class AsyncProfilerAccess {
}
// get an instance of async-profiler
- return AsyncProfiler.getInstance(extractPath.toAbsolutePath().toString());
+ try {
+ return AsyncProfiler.getInstance(extractPath.toAbsolutePath().toString());
+ } catch (UnsatisfiedLinkError e) {
+ throw new RuntimeException("A runtime error occurred whilst loading the native library", e);
+ }
}
/** An instance of the async-profiler Java API. */