Cancel the command op timeout event before we clear out the op from the
session struct. This isn't strictly necessary because command_op_cancel
will "gracefully" handle the case where the tid is no longer present, but
this avoids that noise and is cleaner.
Signed-off-by: Sage Weil <sage@redhat.com>
if (c->onfinish)
c->onfinish->complete(r);
+ if (c->ontimeout) {
+ timer.cancel_event(c->ontimeout);
+ }
+
OSDSession *s = c->session;
s->lock.get_write();
_session_command_op_remove(c->session, c);
s->lock.unlock();
- if (c->ontimeout) {
- timer.cancel_event(c->ontimeout);
- }
c->put();
logger->dec(l_osdc_command_active);