* if m_stop_requested is set then is_replay_interrupted return true.
* also shut_down should set m_stop_requested to false, it is instead
setting it to true this will lead to race and a possible crash accessing GR
b/w shut_down() and notify_group_listener_stop()
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
template <typename I>
bool Replayer<I>::is_replay_interrupted(std::unique_lock<ceph::mutex>* locker) {
- if (m_state == STATE_COMPLETE) {
+ if (m_state == STATE_COMPLETE || m_stop_requested) {
locker->unlock();
return true;
}
{
std::unique_lock locker{m_lock};
- m_stop_requested = true;
+ m_stop_requested = false;
ceph_assert(m_on_shutdown == nullptr);
std::swap(m_on_shutdown, on_finish);