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(); }