diff mbox

cosd multi-second stalls cause "wrongly marked me down"

Message ID 1299799936.4750.378.camel@sale659.sandia.gov (mailing list archive)
State New, archived
Headers show

Commit Message

Jim Schutt March 10, 2011, 11:32 p.m. UTC
None
diff mbox

Patch

diff --git a/src/msg/Message.h b/src/msg/Message.h
index 3758b1b..ac32b94 100644
--- a/src/msg/Message.h
+++ b/src/msg/Message.h
@@ -154,8 +154,14 @@  struct RefCountedObject {
   }
   void put() {
     //generic_dout(0) << "RefCountedObject::put " << this << " " << nref.read() << " -> " << (nref.read() - 1) << dendl;
-    if (nref.dec() == 0)
+    if (nref.dec() == 0) {
+      utime_t s = g_clock.now();
       delete this;
+      utime_t e = g_clock.now();
+      if (e - s > 0.5) {
+	generic_dout(1) << "RefCountedObject::put delete " << this << " took " << e - s << " secs!" << dendl;
+      }
+    }
   }
 };
 
diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc
index 7df3d44..a86ced8 100644
--- a/src/msg/SimpleMessenger.cc
+++ b/src/msg/SimpleMessenger.cc
@@ -2243,6 +2243,23 @@  int SimpleMessenger::Pipe::write_message(Message *m)
   goto out;
 }
 
+/* Clean up sent list */
+void SimpleMessenger::Pipe::handle_ack(uint64_t seq)
+{
+  dout(15) << "reader got ack seq " << seq << dendl;
+  // trim sent list
+  while (!sent.empty() &&
+	 sent.front()->get_seq() <= seq) {
+    Message *m = sent.front();
+    sent.pop_front();
+    dout(10) << "reader got ack seq "
+	     << seq << " >= " << m->get_seq() << " on " << m << " " << *m << dendl;
+    m->put();
+    dout(20) << "handle_ack finished put on " << m << dendl;
+  }
+}
+
+
 
 /********************************************
  * SimpleMessenger
diff --git a/src/msg/SimpleMessenger.h b/src/msg/SimpleMessenger.h
index d6ee0df..4031836 100644
--- a/src/msg/SimpleMessenger.h
+++ b/src/msg/SimpleMessenger.h
@@ -174,20 +174,7 @@  private:
     void fail();
 
     void was_session_reset();
-
-    /* Clean up sent list */
-    void handle_ack(uint64_t seq) {
-      dout(15) << "reader got ack seq " << seq << dendl;
-      // trim sent list
-      while (!sent.empty() &&
-          sent.front()->get_seq() <= seq) {
-        Message *m = sent.front();
-        sent.pop_front();
-        dout(10) << "reader got ack seq "
-            << seq << " >= " << m->get_seq() << " on " << m << " " << *m << dendl;
-        m->put();
-      }
-    }
+    void handle_ack(uint64_t seq);
 
     // threads
     class Reader : public Thread {