X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/5a5c578e2e358a121cdb9234a6cb11c4ecfbf323..3615d9bf0b254442e2fddee45475dbd634cf703a:/handle.cc diff --git a/handle.cc b/handle.cc index 3b6e1fa..1cb5cc2 100644 --- a/handle.cc +++ b/handle.cc @@ -34,19 +34,19 @@ rpcc * handle::safebind() { if (h->cl) return h->cl; rpcc *cl = new rpcc(h->m); - LOG("handler_mgr::acquire_handle trying to bind..." << h->m); + LOG("trying to bind..." << h->m); // The test script assumes that the failure can be detected by paxos and // rsm layer within few seconds. We have to set the timeout with a small // value to support the assumption. // // With RPC_LOSSY=5, tests may fail due to delays and time outs. - int ret = cl->bind(rpcc::to(1000)); + int ret = cl->bind(milliseconds(1000)); if (ret < 0) { - LOG("handle_mgr::acquire_handle bind failure! " << h->m << " " << ret); + LOG("bind failure! " << h->m << " " << ret); delete cl; h->del = true; } else { - LOG("handle_mgr::acquire_handle bind succeeded " << h->m); + LOG("bind succeeded " << h->m); h->cl = cl; } return h->cl; @@ -62,10 +62,11 @@ hinfo * handle_mgr::acquire_handle(string m) { if (hmap.find(m) == hmap.end()) { h = new hinfo(m); hmap[m] = h; + h->refcnt++; } else if (!hmap[m]->del) { h = hmap[m]; + h->refcnt++; } - h->refcnt++; return h; } @@ -82,10 +83,10 @@ void handle_mgr::delete_handle(const string & m) { void handle_mgr::delete_handle(const string & m, lock &) { if (hmap.find(m) == hmap.end()) { - LOG("handle_mgr::delete_handle: cl " << m << " isn't in cl list"); + LOG("cl " << m << " isn't in cl list"); return; } - LOG("handle_mgr::delete_handle: cl " << m << " refcnt " << hmap[m]->refcnt); + LOG("cl " << m << " refcnt " << hmap[m]->refcnt); hinfo *h = hmap[m]; if (h->refcnt == 0) { if (h->cl) {