Deleting executions shouldn't be allowed unless they have finished (SUCCESS/ERROR)

Bug #1598135 reported by Dougal Matthews
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
Medium
Adriano Petrich

Bug Description

It is possible to delete a running execution. This will cause the engine to error as objects can't be found. This report follows a brief discussion on IRC.

    13:05 <jtomasek> rakhmerov: so deleting the execution is also valid way to stop the execution?
    13:06 <rakhmerov> jtomasek: well, yes, you can do this but engine will be cursing that some objects are not found
    13:06 <rakhmerov> when e.g. a running task will be completing
    13:07 <jtomasek> rakhmerov: ah, I see, yeah I am seeing some foreign key errors from time to time when testing this
    13:08 <jtomasek> rakhmerov: so if I update the state of execution to lets say 'ERROR', the running task will finish and no other will get run?
    13:09 <rakhmerov> correct

This isn't an ideal outcome, we should require that users stop an execution before it is deleted.

Mukesh (mukesh007)
Changed in mistral:
assignee: nobody → Mukesh Chandra Kapari (mukeshrocksss7)
Mukesh (mukesh007)
Changed in mistral:
status: New → In Progress
Mukesh (mukesh007)
Changed in mistral:
assignee: Mukesh Chandra Kapari (mukeshrocksss7) → nobody
Revision history for this message
Lucky samadhiya (lucky-samadhiya) wrote :

could you please more explain this issue ??

Changed in mistral:
assignee: nobody → Lucky samadhiya (lucky-samadhiya)
Revision history for this message
Lucky samadhiya (lucky-samadhiya) wrote :

i think this is already take care in code :-
if action_ex.task_execution_id:
            raise exc.NotAllowedException("Only ad-hoc action execution can "
                                          "be deleted.")

        if not states.is_completed(action_ex.state):
            raise exc.NotAllowedException("Only completed action execution "
                                          "can be deleted.")

        return db_api.delete_action_execution(id)

Changed in mistral:
status: In Progress → Fix Committed
assignee: Lucky samadhiya (lucky-samadhiya) → nobody
Changed in mistral:
status: Fix Committed → In Progress
assignee: nobody → Lucky samadhiya (lucky-samadhiya)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to mistral (master)

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

Revision history for this message
Dougal Matthews (d0ugal) wrote :

Removing assignee and moving back to Triaged as there has been no progress in some time. Please re-add yourself if you want to continue the work. The patch looks almost there, it just needs rebasing afaict.

Changed in mistral:
importance: Undecided → Medium
status: In Progress → Triaged
assignee: Lucky samadhiya (lucky-samadhiya) → nobody
tags: added: api low-hanging-fruit
Revision history for this message
Dougal Matthews (d0ugal) wrote :

We possibly will want to add a --force (or similar) to allow deleting if users are really sure. However, we shouldn't do it by default.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on mistral (master)

Change abandoned by Adriano Petrich (<email address hidden>) on branch: master
Review: https://review.openstack.org/373630
Reason: reworking it on a new patch

Changed in mistral:
assignee: nobody → Adriano Petrich (apetrich)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to mistral (master)

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

Changed in mistral:
status: Triaged → In Progress
Dougal Matthews (d0ugal)
tags: added: tripleo
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to python-mistralclient (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/561159

Dougal Matthews (d0ugal)
Changed in mistral:
milestone: none → rocky-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (master)

Reviewed: https://review.openstack.org/560802
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=af84fa9181ecfce9386387300a564b63f37211f4
Submitter: Zuul
Branch: master

commit af84fa9181ecfce9386387300a564b63f37211f4
Author: Adriano Petrich <email address hidden>
Date: Thu Apr 12 08:03:50 2018 +0100

    Only allow for deleting completed executions

    A force parameter was added in case deleting a running execution is
    needed but that will spew all kinds of errors afterwards
    The default is force = False

    Change-Id: I19d822800a1ee056682daeaa7ddf0f400392525d
    Closes-bug: 1598135
    Depends-On: Id935265fcbe0a3072ba2d693edf54b892173fbdf

Changed in mistral:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to python-mistralclient (master)

Reviewed: https://review.openstack.org/561159
Committed: https://git.openstack.org/cgit/openstack/python-mistralclient/commit/?id=e400bed6b0888247eafc90ff338165cfe01e037f
Submitter: Zuul
Branch: master

commit e400bed6b0888247eafc90ff338165cfe01e037f
Author: Adriano Petrich <email address hidden>
Date: Fri Apr 13 09:38:26 2018 +0100

    Add the force parameter to delete executions

    On a related mistral change the force parameter was included to delete
    non finished executions, this change add that option to the cli

    Change-Id: I3408d758bd94038acf2bb9601d4bf2895040f931
    Depends-On: I19d822800a1ee056682daeaa7ddf0f400392525d
    Related-Bug: #1598135

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to mistral (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/568749

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on mistral (stable/queens)

Change abandoned by Dougal Matthews (<email address hidden>) on branch: stable/queens
Review: https://review.openstack.org/568749

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/mistral 7.0.0.0b2

This issue was fixed in the openstack/mistral 7.0.0.0b2 development milestone.

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.