Skip to content

Commit

Permalink
No fatal even when meet unknown errors (#1991)
Browse files Browse the repository at this point in the history
* No fatal even when meet unknown errors
* Avoid exceptions in unloading to avoid to breaking the barrier

Signed-off-by: Tao He <sighingnow@gmail.com>
  • Loading branch information
sighingnow committed Aug 29, 2022
1 parent ce4f0ea commit c8bf5b1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ jobs:
# install pytest
python3 -m pip install pytest pytest-cov
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: false

- name: Run Python Test
if: ${{ needs.changes.outputs.gae-python == 'true' }}
env:
Expand Down
7 changes: 5 additions & 2 deletions analytical_engine/core/grape_instance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,14 @@ bl::result<void> GrapeInstance::unloadGraph(const rpc::GSParams& params) {
bool exists = false;
VY_OK_OR_RAISE(client_->Exists(frag_group_id, exists));
if (exists) {
auto fg = std::dynamic_pointer_cast<vineyard::ArrowFragmentGroup>(
client_->GetObject(frag_group_id));
std::shared_ptr<vineyard::ArrowFragmentGroup> fg;
VY_OK_OR_RAISE(client_->GetObject(frag_group_id, fg));
auto fid = comm_spec_.WorkerToFrag(comm_spec_.worker_id());
auto frag_id = fg->Fragments().at(fid);

// ensure all workers obtain the expected information
MPI_Barrier(comm_spec_.comm());

// delete the fragment group first
if (comm_spec_.worker_id() == 0) {
VINEYARD_SUPPRESS(client_->DelData(frag_group_id, false, true));
Expand Down
9 changes: 6 additions & 3 deletions analytical_engine/core/server/dispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,12 @@ std::shared_ptr<DispatchResult> Dispatcher::processCmd(
return r;
},
[&](const bl::error_info& unmatched) {
LOG(FATAL) << "BUG: Unmatched error, some function may return a new "
"type of error";
return nullptr;
auto r = std::make_shared<DispatchResult>(comm_spec_.worker_id());
std::stringstream error;
error << "Unmatched error detected: " << unmatched;
r->set_error(ErrorCodeToProto(vineyard::ErrorCode::kUnspecificError),
error.str());
return r;
});

if (!r->message().empty()) {
Expand Down

0 comments on commit c8bf5b1

Please sign in to comment.