Merge pull request #15987 from filimonov/background-pool-count_no_work_done-bug

Fix the bug when NOTHING_TO_DO events wrongly increment count_no_work_done
This commit is contained in:
Alexander Kuzmenkov 2020-10-15 16:11:57 +03:00 committed by GitHub
commit f366b366ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -217,8 +217,11 @@ void BackgroundProcessingPool::workLoopFunc()
if (task_result == TaskResult::SUCCESS)
task->count_no_work_done = 0;
else
else if (task_result == TaskResult::ERROR)
++task->count_no_work_done;
/// NOTHING_TO_DO should not increment count_no_work_done
/// otherwise error after period of inactivity (lot of NOTHING_TO_DO)
/// leads to 5-10 min replication hang
/// If task has done work, it could be executed again immediately.
/// If not, add delay before next run.