Skip to content
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

Merged
merged 2 commits into from
Nov 16, 2021

Conversation

critical27
Copy link
Contributor

Separate from #2903, we could recognize time out from exception type:

  1. For storage client, don't call invalidLeader, it will make further request fail again.
  2. For raft client, we should add some back-off time for retry, this will be handled in another PR.

@critical27 critical27 added the ready-for-testing PR: ready for the CI test label Oct 11, 2021
@critical27 critical27 changed the title separate thenValue/thenError when rpc fail separate thenValue/thenError when rpc fail to handle timeout Oct 11, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #3031 (7b4cc7d) into master (e642c05) will decrease coverage by 0.04%.
The diff coverage is 47.66%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
src/clients/storage/StorageClientBase.h 59.32% <ø> (ø)
src/kvstore/raftex/Host.cpp 61.49% <13.33%> (-13.51%) ⬇️
src/clients/storage/StorageClientBase-inl.h 72.41% <60.52%> (-6.16%) ⬇️
src/storage/index/LookupBaseProcessor-inl.h 89.22% <100.00%> (ø)
src/common/thrift/ThriftClientManager-inl.h 82.97% <0.00%> (-6.39%) ⬇️
...eta/processors/session/SessionManagerProcessor.cpp 74.52% <0.00%> (-4.46%) ⬇️
src/graph/session/GraphSessionManager.cpp 79.53% <0.00%> (-1.76%) ⬇️
src/kvstore/wal/test/AtomicLogBufferTest.cpp 94.50% <0.00%> (-1.10%) ⬇️
src/graph/util/SchemaUtil.cpp 91.77% <0.00%> (-0.44%) ⬇️
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c7c1bf8...7b4cc7d. Read the comment docs.

@Sophie-Xie Sophie-Xie added this to the v2.7.0 milestone Oct 12, 2021
@Shylock-Hg
Copy link
Contributor

How about meta client?

@Sophie-Xie Sophie-Xie modified the milestones: v2.7.0, v3.0.0 Oct 15, 2021
@critical27
Copy link
Contributor Author

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?

@Shylock-Hg
Copy link
Contributor

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.

@critical27 critical27 mentioned this pull request Oct 21, 2021
return;
})
.thenError(folly::tag_t<std::exception>{}, [self = shared_from_this()](std::exception&& ex) {
VLOG(2) << self->idStr_ << ex.what();
Copy link
Contributor

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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor

@panda-sheep panda-sheep left a 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) {
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

@liuyu85cn liuyu85cn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@critical27 critical27 merged commit 7f711bb into vesoft-inc:master Nov 16, 2021
@critical27 critical27 deleted the rpc branch November 16, 2021 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants