Remove the duplicate target power state and last error check&update

Bug #1531437 reported by Kan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Invalid
Low
Kan

Bug Description

There is a target power state and last error check and update when changing
node power state, while there is also a target power state and last error check
and update in its following code flow, which is duplicated. They will also be
updated when an error happens before 'node_power_action' is really called in
'power_state_error_handler' hook function.
Will remove the previous one to make the check and update happen in one place.

The previous target power state and last error check&update:
https://github.com/openstack/ironic/blob/master/ironic/conductor/manager.py#L257

The following target power state and last error check&update in right logic:
https://github.com/openstack/ironic/blob/master/ironic/conductor/utils.py#L76
https://github.com/openstack/ironic/blob/master/ironic/conductor/utils.py#L117

The following target power state and last error check&update in error handler hook function:
https://github.com/openstack/ironic/blob/master/ironic/conductor/utils.py#L230

Kan (kansks)
Changed in ironic:
assignee: nobody → Kan (kansks)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

Fix proposed to branch: master
Review: https://review.openstack.org/264527

Changed in ironic:
status: New → In Progress
Dmitry Tantsur (divius)
Changed in ironic:
importance: Undecided → Low
Revision history for this message
Ruby Loo (rloo) wrote : Re: Remove the duplicate target power state check

I don't think this is a bug. We set the node.target_power_state before we spawn a worker to do the work, in case some error happens before utils.node_power_action() makes the change.

Revision history for this message
Kan (kansks) wrote :

Thanks for your comment, Ruby. As I commented in the review patch,
the 'power_state_error_handler' hook function will update the target
power state to NOSTATE instead of maintaining the previous target
power state. And for the right logic, 'node_power_action' will take care
the situation. These ensure the target power state can be set a fully
readable record for the users, so I think there is no need to reset it
before spawn a worker. WDYT?

summary: - Remove the duplicate target power state check
+ Remove the duplicate target power state and last error check&update
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on ironic (master)

Change abandoned by Ruby Loo (<email address hidden>) on branch: master
Review: https://review.openstack.org/264527
Reason: Abandoning because nothing has happened since 2016 and for the reasons why I -2'd it.

Revision history for this message
Iury Gregory Melo Ferreira (iurygregory) wrote :

Marking as invalid due to the inactivity, feel free to reopen if necessary.

Changed in ironic:
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.