Skip to content

Commit

Permalink
Merge pull request #16201 from tchaikov/wip-20432
Browse files Browse the repository at this point in the history
common/Timer: do not add event if already shutdown

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
  • Loading branch information
tchaikov committed Jul 7, 2017
2 parents 07b2e36 + 8c8220c commit 9099d56
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/common/Timer.cc
Expand Up @@ -126,8 +126,11 @@ void SafeTimer::add_event_after(double seconds, Context *callback)
void SafeTimer::add_event_at(utime_t when, Context *callback)
{
assert(lock.is_locked());
ldout(cct,10) << "add_event_at " << when << " -> " << callback << dendl;

ldout(cct,10) << __func__ << " " << when << " -> " << callback << dendl;
if (stopping) {
ldout(cct,5) << __func__ << " already shutdown, event not added" << dendl;
delete callback;
}
scheduled_map_t::value_type s_val(when, callback);
scheduled_map_t::iterator i = schedule.insert(s_val);

Expand Down

0 comments on commit 9099d56

Please sign in to comment.