X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/5a5c578e2e358a121cdb9234a6cb11c4ecfbf323..a5f10a497bebfc680bf418193f1fd9f1ad7cc417:/handle.cc diff --git a/handle.cc b/handle.cc index 3b6e1fa..5287a35 100644 --- a/handle.cc +++ b/handle.cc @@ -34,7 +34,7 @@ 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. @@ -42,11 +42,11 @@ rpcc * handle::safebind() { // With RPC_LOSSY=5, tests may fail due to delays and time outs. int ret = cl->bind(rpcc::to(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) {