While updating the image copy progress, a 'while' loop will pop the
last item from the queue and then deference the empty queue.
Fixes: http://tracker.ceph.com/issues/40368
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit
0f491cbb96ec55c68a627de71ed6ccd781a46dcc)
}
} else {
m_copied_objects.push(object_no);
- while (!m_updating_progress && m_copied_objects.top() ==
- (m_object_number ? *m_object_number + 1 : 0)) {
+ while (!m_updating_progress && !m_copied_objects.empty() &&
+ m_copied_objects.top() ==
+ (m_object_number ? *m_object_number + 1 : 0)) {
m_object_number = m_copied_objects.top();
m_copied_objects.pop();
uint64_t progress_object_no = *m_object_number + 1;