diff options
author | Ilia Cherniavskii <iliacher@fb.com> | 2019-02-20 16:22:01 -0800 |
---|---|---|
committer | Facebook Github Bot <facebook-github-bot@users.noreply.github.com> | 2019-02-20 16:32:24 -0800 |
commit | 0edc81136c138368f500aba5aa0e0667e30befe4 (patch) | |
tree | d0808b77071ea16cbfccbeca6084d72ee3f00d91 | |
parent | 0337494c6a498f5c208a402d01a2a46020f9e6bd (diff) | |
download | pytorch-0edc81136c138368f500aba5aa0e0667e30befe4.tar.gz pytorch-0edc81136c138368f500aba5aa0e0667e30befe4.tar.bz2 pytorch-0edc81136c138368f500aba5aa0e0667e30befe4.zip |
Rethrow exceptions from RunAsync (#15034)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15034
Rethrow exception happened during RunAsync, ensure that pending tasks
are not executed after marked as finished
Reviewed By: andrewwdye
Differential Revision: D13409649
fbshipit-source-id: 3fd12b3dcf32af4752f8b6e55eb7a92812a5c057
-rw-r--r-- | caffe2/core/net_async_scheduling.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/caffe2/core/net_async_scheduling.cc b/caffe2/core/net_async_scheduling.cc index 3e0f36613e..8b6f13354b 100644 --- a/caffe2/core/net_async_scheduling.cc +++ b/caffe2/core/net_async_scheduling.cc @@ -254,7 +254,11 @@ bool AsyncSchedulingNet::RunAsync() { } catch (const std::exception& e) { LOG(ERROR) << "Exception while starting an async run: " << e.what(); finishRun(); - return false; + throw; + } catch (...) { + LOG(ERROR) << "Exception while starting an async run: unknown error"; + finishRun(); + throw; } // schedule() is not expected to throw, at this moment all the initial tasks |