]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OpTracker: Race condition removed while dumping ops through admin socket 2440/head
authorSomnath Roy <somnath.roy@sandisk.com>
Tue, 9 Sep 2014 02:40:29 +0000 (19:40 -0700)
committerSomnath Roy <somnath.roy@sandisk.com>
Thu, 11 Sep 2014 18:22:59 +0000 (11:22 -0700)
OSD was crashing due to a race condition while IO was going on and
user wants to dump in flight ops. This was happening because Message
data and payloads are removed before the op itself is removed from
the in flight list. Calling op->_unregistered() after removing
the op from the in flight list fixes the issue.

Fixes: #9384
Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
src/common/TrackedOp.cc

index d7a95b87ac1ff3b109ee3b2d4f3e9bd463aae08c..32dbc5398dcc20ff23634354e13afac1fa611a78 100644 (file)
@@ -145,6 +145,7 @@ void OpTracker::unregister_inflight_op(TrackedOp *i)
     assert(i->xitem.get_list() == &sdata->ops_in_flight_sharded);
     i->xitem.remove_myself();
   }
+  i->_unregistered();
   utime_t now = ceph_clock_now(cct);
   history.insert(now, TrackedOpRef(i));
 }
@@ -294,8 +295,8 @@ void OpTracker::_mark_event(TrackedOp *op, const string &evt,
 
 void OpTracker::RemoveOnDelete::operator()(TrackedOp *op) {
   op->mark_event("done");
-  op->_unregistered();
   if (!tracker->tracking_enabled) {
+    op->_unregistered();
     delete op;
     return;
   }