-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
separate thenValue/thenError when rpc fail to handle timeout #3031
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3031 +/- ##
==========================================
- Coverage 84.34% 84.30% -0.05%
==========================================
Files 1283 1283
Lines 113684 113705 +21
==========================================
- Hits 95891 95857 -34
- Misses 17793 17848 +55
Continue to review full report at Codecov.
|
How about meta client? |
Meta client already has a retry mechanism, and all rpc in meta should be small enough, there should not be any timeout. I'll add it if necessary. WDYT? |
Got. |
return; | ||
}) | ||
.thenError(folly::tag_t<std::exception>{}, [self = shared_from_this()](std::exception&& ex) { | ||
VLOG(2) << self->idStr_ << ex.what(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message should use LOG(ERROR)?
}) | ||
.thenError(folly::tag_t<TransportException>{}, | ||
[self = shared_from_this(), req](TransportException&& ex) { | ||
VLOG(2) << self->idStr_ << ex.what(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!👍
} else if (code.get_code() == nebula::cpp2::ErrorCode::E_PART_NOT_FOUND || | ||
code.get_code() == nebula::cpp2::ErrorCode::E_SPACE_NOT_FOUND) { | ||
invalidLeader(spaceId, code.get_part_id()); | ||
.thenValue([this, context, host, spaceId, start](Response&& resp) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the difference between then
and thenValue
is separate error handling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, then = thenTry = thenValue + thenError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Separate from #2903, we could recognize time out from exception type:
invalidLeader
, it will make further request fail again.