@@ -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;
+ }
+ }
}
};
@@ -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
@@ -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 {