mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-26 16:44:54 +08:00
Replace FutureMessage with ivalue::Future in RRefContext (#49960)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/49960 Test Plan: Imported from OSS Reviewed By: lw Differential Revision: D25730530 Pulled By: mrshenli fbshipit-source-id: 5d54572c653592d79c40aed616266c87307a1ad8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
25ef605132
commit
008206decc
@ -67,21 +67,21 @@ RRefForkData RRef::fork() const {
|
||||
|
||||
void RRef::handleError(
|
||||
RPCErrorType errorType,
|
||||
const FutureMessage& futMessage) {
|
||||
const JitFuture& jitFuture) {
|
||||
static std::unordered_map<
|
||||
RPCErrorType,
|
||||
std::function<void(const FutureMessage& fm)>,
|
||||
std::function<void(const JitFuture& jitFuture)>,
|
||||
std::hash<int>>
|
||||
errorHandlers = {
|
||||
{RPCErrorType::TIMEOUT,
|
||||
[this](const FutureMessage& /* unused */) { setTimedOut(); }},
|
||||
[this](const JitFuture& /* unused */) { setTimedOut(); }},
|
||||
{RPCErrorType::INTENTIONAL_FAILURE,
|
||||
[this](const FutureMessage& /* unused */) { setTimedOut(); }},
|
||||
{RPCErrorType::UNKNOWN_ERROR, [](const FutureMessage& fm) {
|
||||
[this](const JitFuture& /* unused */) { setTimedOut(); }},
|
||||
{RPCErrorType::UNKNOWN_ERROR, [](const JitFuture& jitFuture) {
|
||||
// Default error handler
|
||||
RRefContext::handleException(fm);
|
||||
RRefContext::handleException(jitFuture);
|
||||
}}};
|
||||
errorHandlers.find(errorType)->second(futMessage);
|
||||
errorHandlers.find(errorType)->second(jitFuture);
|
||||
}
|
||||
|
||||
////////////////////////// UserRRef /////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user