projects
/
invirt/third/libt4.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More clean-ups
[invirt/third/libt4.git]
/
config.cc
diff --git
a/config.cc
b/config.cc
index
727277e
..
38c4c05
100644
(file)
--- a/
config.cc
+++ b/
config.cc
@@
-88,7
+88,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);
LOG("is " << mem << " still a member?");
if (!isamember(mem, newmem) && me != mem) {
LOG("delete " << mem);
- invalidate_handle(mem);
+ handle(mem).invalidate();
}
}
}
}
@@
-149,7
+149,7
@@
void config::heartbeater() [[noreturn]] {
lock cfg_mutex_lock(cfg_mutex);
while (1) {
lock cfg_mutex_lock(cfg_mutex);
while (1) {
- auto next_timeout = steady_clock::now() + seconds(3);
+ auto next_timeout = steady_clock::now() + milliseconds(300);
LOG("go to sleep");
config_cond.wait_until(cfg_mutex_lock, next_timeout);
LOG("go to sleep");
config_cond.wait_until(cfg_mutex_lock, next_timeout);
@@
-202,18
+202,18
@@
config::heartbeat_t config::doheartbeat(const string &m, lock &cfg_mutex_lock) {
handle h(m);
cfg_mutex_lock.unlock();
handle h(m);
cfg_mutex_lock.unlock();
- int r = 0, ret = rpc_const::bind_failure;
+ int r = 0, ret = rpc_protocol::bind_failure;
if (rpcc *cl = h.safebind())
if (rpcc *cl = h.safebind())
- ret = cl->call_timeout(paxos_protocol::heartbeat, rpcc::to(1000), r, me, vid);
+ ret = cl->call_timeout(paxos_protocol::heartbeat, milliseconds(100), r, me, vid);
cfg_mutex_lock.lock();
heartbeat_t res = OK;
switch (ret) {
case paxos_protocol::OK:
break;
cfg_mutex_lock.lock();
heartbeat_t res = OK;
switch (ret) {
case paxos_protocol::OK:
break;
- case rpc_const::atmostonce_failure:
- case rpc_const::oldsrv_failure:
- invalidate_handle(m);
+ case rpc_protocol::atmostonce_failure:
+ case rpc_protocol::oldsrv_failure:
+ h.invalidate();
break;
default:
LOG("problem with " << m << " (" << ret << ") my vid " << vid << " his vid " << r);
break;
default:
LOG("problem with " << m << " (" << ret << ") my vid " << vid << " his vid " << r);