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

fix a bug may stuck #3306

Merged
merged 3 commits into from
Nov 12, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions src/storage/transaction/ChainAddEdgesProcessorLocal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,25 @@ folly::SemiFuture<Code> ChainAddEdgesProcessorLocal::forwardToDelegateProcessor(
};
auto futProc = proc->getFuture();
auto [pro, fut] = folly::makePromiseContract<Code>();
std::move(futProc).thenValue([&, p = std::move(pro)](auto&& resp) mutable {
auto rc = extractRpcError(resp);
if (rc == Code::SUCCEEDED) {
if (FLAGS_trace_toss) {
for (auto& k : kvErased_) {
VLOG(1) << uuid_ << " erase prime " << folly::hexlify(k);
std::move(futProc).thenTry([&, p = std::move(pro)](auto&& t) mutable {
auto rc = Code::SUCCEEDED;
if (t.hasException()) {
LOG(INFO) << "catch ex: " << t.exception().what();
rc = Code::E_UNKNOWN;
} else {
auto& resp = t.value();
rc = extractRpcError(resp);
if (rc == Code::SUCCEEDED) {
if (FLAGS_trace_toss) {
for (auto& k : kvErased_) {
VLOG(1) << uuid_ << " erase prime " << folly::hexlify(k);
}
}
} else {
VLOG(1) << uuid_ << " forwardToDelegateProcessor(), code = "
<< apache::thrift::util::enumNameSafe(rc);
addUnfinishedEdge(ResumeType::RESUME_CHAIN);
}
} else {
VLOG(1) << uuid_
<< " forwardToDelegateProcessor(), code = " << apache::thrift::util::enumNameSafe(rc);
addUnfinishedEdge(ResumeType::RESUME_CHAIN);
}
p.setValue(rc);
});
Expand Down