[openstack-dev] [openstack][ironic] Event processing for async task improvement

Yuriy Zveryanskyy yzveryanskyy at mirantis.com
Sat Oct 22 16:57:40 UTC 2016


Hi.

There is state rollback mechanism in ironic if conductor work thread can
not be started for change provision state via API. And looks like we need
the same for
cleaning [1].
This mechanism can not be clearly integrated with provision state
notifications,
in the start -> (end or error) scheme imlemented for async task error is
"permanent" externally visible error like provision error, cleaning error,
there is no FSM event that triggered this rollback etc. Due to these
reasons current implementation of provision state notifications is
overcomplex and potentially raceable [2].
I propose do not change provision state until work thread is started. RFC
7231 does not require any type of "sync start" [3].
All needed changes look like internal refactoring, no changes visible from
external world.
Details:
- remove all callback related parameters from process_event() method. This
is not
breaking change because these parameters should be only used for conductor
and not for drivers;
- add event and related parameter to spawn_after() method. This method
should only process event on the FSM and does not apply state changes to
the node
object and DB;
- add new method post_process_event() (apply_states?) to task manager.
Create
a decorator that calls this method using task instance from args before main
function. Not needed to add this decorator in the code manually to each
function,
callback functions can be decorated inside task manager;
- remove hooks function for provision and cleaning, logging and last error
setting
can be done inside task manager.

Have a nice time on the Summit.
Note that I'm on PTO until Oct 31.

[1] https://bugs.launchpad.net/ironic/+bug/1635619
[2] https://review.openstack.org/#/c/348437/
[3] https://tools.ietf.org/html/rfc7231#section-6.3.3

Yuriy Zveryanskyy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20161022/fb10b062/attachment.html>


More information about the OpenStack-dev mailing list