From: Somnath Roy Date: Tue, 9 Sep 2014 02:40:29 +0000 (-0700) Subject: OpTracker: Race condition removed while dumping ops through admin socket X-Git-Tag: v0.86~43^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=11082f7aa02f3f41c7c74c5930b67216dba88ea1;p=ceph.git OpTracker: Race condition removed while dumping ops through admin socket 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 --- diff --git a/src/common/TrackedOp.cc b/src/common/TrackedOp.cc index d7a95b87ac1f..32dbc5398dcc 100644 --- a/src/common/TrackedOp.cc +++ b/src/common/TrackedOp.cc @@ -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; }