rocksdb
rocksdb copied to clipboard
Fix periodic_task unable to re-register the same task type
Timer has a limitation that it cannot re-register a task with the same name, because the cancel only mark the task as invalid and wait for the Timer thread to clean it up later, before the task is cleaned up, the same task name cannot be added. Which makes the task option update likely to fail, which basically cancel and re-register the same task name. Change the periodic task name to a random unique id and store it in periodic_task_scheduler.
Also refactor the periodic_work
to periodic_task
to make each job function
as a task
.
Test Plan: unittests
@jay-zhuang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@jay-zhuang has updated the pull request. You must reimport the pull request before landing.
@jay-zhuang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@jay-zhuang has updated the pull request. You must reimport the pull request before landing.
@jay-zhuang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@jay-zhuang has updated the pull request. You must reimport the pull request before landing.
@jay-zhuang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.