journal: disconnect watch after watch error

Fixes: #14168
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
Jason Dillaman 2016-01-04 23:13:16 -05:00
parent 749c42422e
commit a3ac03e5ae

View File

@ -364,6 +364,13 @@ void JournalMetadata::handle_watch_error(int err) {
lderr(m_cct) << "journal watch error: " << cpp_strerror(err) << dendl;
Mutex::Locker timer_locker(m_timer_lock);
Mutex::Locker locker(m_lock);
// release old watch on error
if (m_watch_handle != 0) {
m_ioctx.unwatch2(m_watch_handle);
m_watch_handle = 0;
}
if (m_initialized && err != -ENOENT) {
schedule_watch_reset();
}