X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/26ade07ab0e62b98b452fbbd18edba0450035e35..3efa02fb3a9f0a0566a7f3c99a1efb94e30ea4a6:/config.cc?ds=inline diff --git a/config.cc b/config.cc index e1b0963..a177362 100644 --- a/config.cc +++ b/config.cc @@ -1,5 +1,6 @@ #include "config.h" -#include "handle.h" + +using std::vector; // The config module maintains views. As a node joins or leaves a // view, the next view will be the same as previous view, except with @@ -83,7 +84,7 @@ void config::paxos_commit(unsigned instance, const string & value) { LOG << "is " << mem << " still a member?"; if (!isamember(mem, newmem) && me != mem) { LOG << "delete " << mem; - handle(mem).invalidate(); + rpcc::unbind_cached(mem); } } @@ -196,11 +197,10 @@ config::heartbeat_t config::doheartbeat(const string & m, lock & cfg_mutex_lock) VERIFY(cfg_mutex_lock); unsigned vid = my_view_id; LOG << "heartbeat to " << m << " (" << vid << ")"; - handle h(m); cfg_mutex_lock.unlock(); int r = 0, ret = rpc_protocol::bind_failure; - if (rpcc *cl = h.safebind()) + if (auto cl = rpcc::bind_cached(m)) ret = cl->call_timeout(paxos_protocol::heartbeat, milliseconds(100), r, me, vid); cfg_mutex_lock.lock(); @@ -210,7 +210,7 @@ config::heartbeat_t config::doheartbeat(const string & m, lock & cfg_mutex_lock) break; case rpc_protocol::atmostonce_failure: case rpc_protocol::oldsrv_failure: - h.invalidate(); + rpcc::unbind_cached(m); break; default: LOG << "problem with " << m << " (" << ret << ") my vid " << vid << " his vid " << r;