diff options
author | Luck <git@lucko.me> | 2022-05-05 21:26:15 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2022-05-05 21:26:15 +0100 |
commit | d61469c0b2a356a886404cbf22767ef07048facf (patch) | |
tree | 720edf29d72e06b5e03c34530182ff08f17085eb /spark-common | |
parent | 4fa21179b38a176c54b134295ae1c3a5e38f2288 (diff) | |
download | spark-d61469c0b2a356a886404cbf22767ef07048facf.tar.gz spark-d61469c0b2a356a886404cbf22767ef07048facf.tar.bz2 spark-d61469c0b2a356a886404cbf22767ef07048facf.zip |
Ignore "inactive" error when stopping the async profiler (#191)
Diffstat (limited to 'spark-common')
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncSampler.java | 9 |
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(); |