Switch periodic tasks to the Futurist library¶
Futurist is a new Oslo library providing tools for writing asynchronous code. This spec suggests switching our periodic task implementation to Futurist to solve some long-standing problems.
The main problem with our current implementation is that we run all periodic tasks in one thread. Any task that blocks for a while would block all other tasks from executing, and it happens pretty often with tasks checking power states via IPMI.
Switch to Futurist will allow executing all tasks in parallel.
Modify conductor to use Futurist library instead of implementation from oslo incubator.
Existing worker pool will be reused for periodic tasks. So, existing option
workers_pool_sizewill set maximum number of tasks to run in parallel at every moment of time.
Switch all use cases of
ironic.openstack.common.periodic_taskto Futurist decorators, and drop this module.
ironic.drivers.base.driver_periodic_taskto using Futurist decorators internally and deprecate it.
We could fix existing implementation. That’s not actually easier, as it requires essentially rewriting it.
Data model impact¶
State Machine Impact¶
REST API impact¶
Client (CLI) impact¶
RPC API impact¶
Driver API impact¶
Old way of creating driver periodic tasks will be deprecated, drivers should eventually switch to using Futurist decorators.
Nova driver impact¶
Other end user impact¶
Overall positive impact on scalability expected, as every Ironic conductor will be able (at least theoretically) to manage more IPMI nodes.
A periodic tasks performance will no longer affect timing of other periodic tasks.
Other deployer impact¶
- Primary assignee:
Dmitry Tantsur (irc: dtantsur, lp: divius)
The only big dependency is Futurist itself. At the moment of writing it didn’t see an official release yet, but is moving pretty fast and all required code already landed in git master.
Unit tests should already cover this functionality. Specific tests ensuring parallelization will be added.
Upgrades and Backwards Compatibility¶
Documentation of driver periodic tasks should be updated to mention Futurist instead of ad-hoc implementation.