Skip to content

Commit

Permalink
Addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hkadayam committed Mar 6, 2024
1 parent d02cc6c commit aec9515
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/lib/manager_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ nuraft::cmd_result_code ManagerImpl::group_init(int32_t const srv_id, group_id_t
smgr = it->second;
smgr->become_ready();
sm = smgr->get_state_machine();
smgr->set_manager_impl(std::weak_ptr< ManagerImpl >(shared_from_this()));
smgr->set_manager_impl(shared_from_this());
} else {
return nuraft::cmd_result_code::CANCELLED;
}
Expand All @@ -204,7 +204,7 @@ nuraft::cmd_result_code ManagerImpl::group_init(int32_t const srv_id, group_id_t
std::shared_ptr< nuraft::rpc_listener > listener;

nuraft::ptr< nuraft::logger > logger = std::make_shared< nuraft_mesg_logger >(group_id, _custom_logger);
auto base_smgr = std::dynamic_pointer_cast< nuraft::state_mgr >(smgr);
auto base_smgr = std::static_pointer_cast< nuraft::state_mgr >(smgr);
ctx = new nuraft::context(base_smgr, sm, listener, logger, rpc_cli_factory, _scheduler, params);
ctx->set_cb_func([wp = std::weak_ptr< mesg_state_mgr >(smgr), group_id](nuraft::cb_func::Type type,
nuraft::cb_func::Param* param) {
Expand Down Expand Up @@ -365,9 +365,7 @@ void mesg_state_mgr::make_repl_ctx(grpc_server* server, std::shared_ptr< mesg_fa
nuraft::cb_func::ReturnCode mesg_state_mgr::internal_raft_event_handler(group_id_t const& group_id,
nuraft::cb_func::Type type,
nuraft::cb_func::Param* param) {
auto const [handled, ret] = handle_raft_event(type, param);
if (handled) { return ret; }

if (auto const [handled, ret] = handle_raft_event(type, param); handled) { return ret; }
return m_manager.lock()->generic_raft_event_handler(group_id, type, param);
}

Expand Down

0 comments on commit aec9515

Please sign in to comment.