aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2022-05-05 21:26:15 +0100
committerLuck <git@lucko.me>2022-05-05 21:26:15 +0100
commitd61469c0b2a356a886404cbf22767ef07048facf (patch)
tree720edf29d72e06b5e03c34530182ff08f17085eb
parent4fa21179b38a176c54b134295ae1c3a5e38f2288 (diff)
downloadspark-d61469c0b2a356a886404cbf22767ef07048facf.tar.gz
spark-d61469c0b2a356a886404cbf22767ef07048facf.tar.bz2
spark-d61469c0b2a356a886404cbf22767ef07048facf.zip
Ignore "inactive" error when stopping the async profiler (#191)
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncSampler.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncSampler.java b/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncSampler.java
index 60c4e03..5cb7fdc 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncSampler.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncSampler.java
@@ -144,7 +144,14 @@ public class AsyncSampler extends AbstractSampler {
*/
@Override
public void stop() {
- this.profiler.stop();
+ try {
+ this.profiler.stop();
+ } catch (IllegalStateException e) {
+ if (!e.getMessage().equals("Profiler is not active")) { // ignore
+ throw e;
+ }
+ }
+
if (this.timeoutExecutor != null) {
this.timeoutExecutor.shutdown();