diff --git a/mindspore/ccsrc/backend/session/executor.cc b/mindspore/ccsrc/backend/session/executor.cc index cb7cf3777e..202410b143 100644 --- a/mindspore/ccsrc/backend/session/executor.cc +++ b/mindspore/ccsrc/backend/session/executor.cc @@ -279,6 +279,9 @@ void Executor::ClearDoneTasks() { } void Executor::RunTask(const std::shared_ptr &task, bool sync, bool long_run) { + if (sync) { + ClearDoneTasks(); + } { std::lock_guard lock(task_mutex_); sync_run_task_finished_ = false;