Skip to content

Commit 0edc811

Browse files
Ilia Cherniavskiifacebook-github-bot
Ilia Cherniavskii
authored andcommitted
Rethrow exceptions from RunAsync (pytorch#15034)
Summary: Pull Request resolved: pytorch#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
1 parent 0337494 commit 0edc811

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

caffe2/core/net_async_scheduling.cc

+5-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,11 @@ bool AsyncSchedulingNet::RunAsync() {
254254
} catch (const std::exception& e) {
255255
LOG(ERROR) << "Exception while starting an async run: " << e.what();
256256
finishRun();
257-
return false;
257+
throw;
258+
} catch (...) {
259+
LOG(ERROR) << "Exception while starting an async run: unknown error";
260+
finishRun();
261+
throw;
258262
}
259263

260264
// schedule() is not expected to throw, at this moment all the initial tasks

0 commit comments

Comments
 (0)