Skip to content

Commit a831ecc

Browse files
authored
Add grpc error context. (#13957)
Add grpc error context
1 parent 67a2b52 commit a831ecc

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

paddle/fluid/operators/distributed/grpc_client.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

15-
#include "paddle/fluid/operators/distributed/grpc_client.h"
16-
1715
#include <sys/time.h>
18-
1916
#include <limits>
2017

2118
#include "glog/logging.h" // For VLOG
2219
#include "paddle/fluid/framework/threadpool.h"
20+
#include "paddle/fluid/operators/distributed/grpc_client.h"
2321
#include "paddle/fluid/operators/distributed/grpc_serde.h"
2422
#include "paddle/fluid/operators/distributed/request_handler.h"
2523
#include "paddle/fluid/platform/profiler.h"
@@ -336,16 +334,22 @@ void GRPCClient::Proceed() {
336334
VLOG(3) << c->GetVarHandlePtr()->String() << " process";
337335
c->Process();
338336
} else if (c->status_.error_code() == grpc::StatusCode::DEADLINE_EXCEEDED) {
337+
// FIXME(gongwb): parse error_details?
339338
LOG(ERROR) << c->GetVarHandlePtr()->String()
340-
<< " meets grpc error:" << c->status_.error_message();
339+
<< " meets grpc error, error_code:" << c->status_.error_code()
340+
<< " error_message:" << c->status_.error_message()
341+
<< " error_details:" << c->status_.error_details();
341342
{
342343
std::lock_guard<std::mutex> lk(sync_mutex_);
343344
ok_ = false;
344345
}
345346
c->Finish(false);
346347
} else {
347348
LOG(FATAL) << c->GetVarHandlePtr()->String()
348-
<< " meets grpc error:" << c->status_.error_message();
349+
<< " meets grpc error, error_code:" << c->status_.error_code()
350+
<< " error_message:" << c->status_.error_message()
351+
<< " error_details:" << c->status_.error_details();
352+
349353
c->Finish(false);
350354
}
351355

0 commit comments

Comments
 (0)