From 98339ed2357ac71dddd82eaed127eda8fbe3e700 Mon Sep 17 00:00:00 2001 From: xtcyclist <7731943+xtcyclist@users.noreply.github.com> Date: Fri, 23 Dec 2022 12:03:44 +0800 Subject: [PATCH 1/3] remove nullptr. --- src/clients/storage/StorageClientBase-inl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clients/storage/StorageClientBase-inl.h b/src/clients/storage/StorageClientBase-inl.h index b041c21bc57..6a2bf33fdc6 100644 --- a/src/clients/storage/StorageClientBase-inl.h +++ b/src/clients/storage/StorageClientBase-inl.h @@ -203,7 +203,7 @@ folly::Future> StorageClientBasewhat(); + LOG(ERROR) << "Request to " << host << " failed."; } return Status::Error("RPC failure in StorageClient, probably timeout: %s", ex->what()); }); From d18cda8b2b0a305ea3268f4829fa094fbcb88bc1 Mon Sep 17 00:00:00 2001 From: xtcyclist <7731943+xtcyclist@users.noreply.github.com> Date: Fri, 23 Dec 2022 13:42:51 +0800 Subject: [PATCH 2/3] fix another line. --- src/clients/storage/StorageClientBase-inl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/clients/storage/StorageClientBase-inl.h b/src/clients/storage/StorageClientBase-inl.h index 6a2bf33fdc6..fc935c47bfa 100644 --- a/src/clients/storage/StorageClientBase-inl.h +++ b/src/clients/storage/StorageClientBase-inl.h @@ -200,12 +200,13 @@ folly::Future> StorageClientBase(); if (ex && ex->getType() == TransportException::TIMED_OUT) { LOG(ERROR) << "Request to " << host << " time out: " << ex->what(); + return Status::Error("RPC failure in StorageClient, probably timeout: %s", ex->what()); } else { auto partsId = getReqPartsId(request); invalidLeader(spaceId, partsId); LOG(ERROR) << "Request to " << host << " failed."; + return Status::Error("RPC failure in StorageClient, probably timeout."); } - return Status::Error("RPC failure in StorageClient, probably timeout: %s", ex->what()); }); } From 2583a78abab439348d396a1c2e161727fc89ca7f Mon Sep 17 00:00:00 2001 From: xtcyclist <7731943+xtcyclist@users.noreply.github.com> Date: Fri, 23 Dec 2022 18:47:16 +0800 Subject: [PATCH 3/3] revise codes. --- src/clients/storage/StorageClientBase-inl.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/clients/storage/StorageClientBase-inl.h b/src/clients/storage/StorageClientBase-inl.h index fc935c47bfa..6e069acc069 100644 --- a/src/clients/storage/StorageClientBase-inl.h +++ b/src/clients/storage/StorageClientBase-inl.h @@ -198,14 +198,19 @@ folly::Future> StorageClientBase(); - if (ex && ex->getType() == TransportException::TIMED_OUT) { - LOG(ERROR) << "Request to " << host << " time out: " << ex->what(); - return Status::Error("RPC failure in StorageClient, probably timeout: %s", ex->what()); + if (ex) { + if (ex->getType() == TransportException::TIMED_OUT) { + LOG(ERROR) << "Request to " << host << " time out: " << ex->what(); + return Status::Error("RPC failure in StorageClient with timeout: %s", ex->what()); + } else { + LOG(ERROR) << "Request to " << host << " failed: " << ex->what(); + return Status::Error("RPC failure in StorageClient: %s", ex->what()); + } } else { auto partsId = getReqPartsId(request); invalidLeader(spaceId, partsId); LOG(ERROR) << "Request to " << host << " failed."; - return Status::Error("RPC failure in StorageClient, probably timeout."); + return Status::Error("RPC failure in StorageClient."); } }); }