From 51d6dbdffed75086c5d3c1e1308fb15e5623579b Mon Sep 17 00:00:00 2001 From: kswang Date: Wed, 6 Jan 2021 10:47:14 +0800 Subject: [PATCH] reset exception listener --- mindspore/ccsrc/backend/session/executor.cc | 1 + mindspore/core/ir/tensor.h | 1 + 2 files changed, 2 insertions(+) diff --git a/mindspore/ccsrc/backend/session/executor.cc b/mindspore/ccsrc/backend/session/executor.cc index ff46cf7ed0..db250503b4 100644 --- a/mindspore/ccsrc/backend/session/executor.cc +++ b/mindspore/ccsrc/backend/session/executor.cc @@ -292,6 +292,7 @@ void Executor::RunTask(const std::shared_ptr &task, bool sync) { return finished; }); } + ClearDoneTasks(); MsException::Instance().CheckException(); } diff --git a/mindspore/core/ir/tensor.h b/mindspore/core/ir/tensor.h index f68df3cd5b..f2427a935b 100644 --- a/mindspore/core/ir/tensor.h +++ b/mindspore/core/ir/tensor.h @@ -89,6 +89,7 @@ class WaitEvent : public ExceptionListener { } MsException::Instance().SetExceptionListener(const_cast(this)); cond_var_.wait(lock, [this] { return !need_wait_; }); + MsException::Instance().SetExceptionListener(nullptr); MsException::Instance().CheckException(); }