access2rohit commented on a change in pull request #14397: Add exception handling support for waitall URL: https://github.com/apache/incubator-mxnet/pull/14397#discussion_r269385195
########## File path: src/engine/threaded_engine.cc ########## @@ -415,6 +415,23 @@ void ThreadedEngine::WaitForAll() { finished_cv_.wait(lock, [this]() { return pending_.load() == 0 || kill_.load(); }); + std::exception_ptr exception_to_rethrow = nullptr; + if (!global_exception_refs_.empty()) { + // iterate through all exception refs + for (const auto& global_exception_ref : global_exception_refs_) { + // the first exception will be saved to be rethrown later Review comment: What is the order of exceptions stored in the "global_exception_refs_" ? If we are throwing the first one then is it the innermost in the stack that causes all other exceptions or the outermost ? If its outermost then it might not give correct idea about what was the root cause ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services