Project

General

Profile

bugfix.patch

A fix - Adam Emerson, 01/07/2016 06:55 PM

Download (2.43 KB)

View differences:

src/osdc/Objecter.cc
451 451
    cop->put();
452 452
  }
453 453

  
454
  if (tick_event) {
455
    if (timer.cancel_event(tick_event)) {
454
  if (tick_event.read()) {
455
    if (timer.cancel_event(tick_event.read())) {
456 456
      ldout(cct, 10) <<  " successfully canceled tick" << dendl;
457
      tick_event = 0;
458 457
    }
459 458
  }
459
  tick_event.set(0);
460 460

  
461 461
  if (m_request_state_hook) {
462 462
    AdminSocket* admin_socket = cct->get_admin_socket();
......
474 474
  // Let go of Objecter write lock so timer thread can shutdown
475 475
  rwlock.unlock();
476 476

  
477
  assert(tick_event == 0);
477
  // Make sure it didn't get rescheduled
478
  assert(tick_event.read() == 0);
478 479
}
479 480

  
480 481
void Objecter::_send_linger(LingerOp *info)
......
1973 1974

  
1974 1975
void Objecter::start_tick()
1975 1976
{
1976
  assert(tick_event == 0);
1977
  tick_event =
1977
  assert(tick_event.read() == 0);
1978
  tick_event.set(
1978 1979
    timer.add_event(ceph::make_timespan(cct->_conf->objecter_tick_interval),
1979
		    &Objecter::tick, this);
1980
		    &Objecter::tick, this));
1980 1981
}
1981 1982

  
1982 1983
void Objecter::tick()
......
1986 1987
  ldout(cct, 10) << "tick" << dendl;
1987 1988

  
1988 1989
  // we are only called by C_Tick
1989
  assert(tick_event);
1990
  tick_event = 0;
1990
  assert(tick_event.read());
1991
  tick_event.set(0);
1991 1992

  
1992 1993
  if (!initialized.read()) {
1993 1994
    // we raced with shutdown
......
2062 2063
    }
2063 2064
  }
2064 2065

  
2065
  // reschedule
2066
  tick_event = timer.reschedule_me(ceph::make_timespan(
2067
				     cct->_conf->objecter_tick_interval));
2066
  // Make sure we don't resechedule if we wake up after shutdown
2067
  if (initialized.read()) {
2068
    tick_event.set(timer.reschedule_me(ceph::make_timespan(
2069
					 cct->_conf->objecter_tick_interval)));
2070
  }
2068 2071
}
2069 2072

  
2070 2073
void Objecter::resend_mon_ops()
......
4795 4798
  assert(check_latest_map_ops.empty());
4796 4799
  assert(check_latest_map_commands.empty());
4797 4800

  
4798
  assert(!tick_event);
4801
  assert(!tick_event.read());
4799 4802
  assert(!m_request_state_hook);
4800 4803
  assert(!logger);
4801 4804
}
src/osdc/Objecter.h
1133 1133

  
1134 1134
  PerfCounters *logger;
1135 1135

  
1136
  uint64_t tick_event;
1136
  atomic_t tick_event;
1137 1137

  
1138 1138
  void start_tick();
1139 1139
  void tick();