Prevent leases from being deleted during event execution

A user can request to delete a lease while it is changing state via
event execution, which can trigger an error condition as on_end will
attempt to delete the corresponding aggregate.

This commit prevents a lease from being deleted while its start_lease or
end_lease events are in progress.

Change-Id: I73bde0219b6ea30d16564fd2507fd59d52cbfa6a
Closes-Bug: #1791741
This commit is contained in:
Pierre Riteau 2019-02-18 17:50:54 +00:00
parent 1855e059fc
commit 00760ae25b
2 changed files with 13 additions and 2 deletions

View File

@ -307,8 +307,12 @@ COMBINATIONS = {
},
LeaseStatus.DELETING: {
'reservation': ReservationStatus.ALL,
'start_lease': EventStatus.ALL,
'end_lease': EventStatus.ALL
'start_lease': (EventStatus.UNDONE,
EventStatus.DONE,
EventStatus.ERROR),
'end_lease': (EventStatus.UNDONE,
EventStatus.DONE,
EventStatus.ERROR)
},
LeaseStatus.UPDATING: {
'reservation': ReservationStatus.ALL,

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Blazar now prevents leases from being deleted while their start_lease or
end_lease events are in progress, to avoid concurrently accessing shared
objects. For more details, see `bug 1791741
<https://bugs.launchpad.net/blazar/+bug/1791741>`_.