Merge ~mpontillo/maas:prevent-ip-removal-on-bridge-release--bug-1792409 into maas:master
Proposed by
Mike Pontillo
Status: | Merged |
---|---|
Approved by: | Mike Pontillo |
Approved revision: | bfefc4842bfd0d35bd7f9251b1f41565545f6e77 |
Merge reported by: | MAAS Lander |
Merged at revision: | not available |
Proposed branch: | ~mpontillo/maas:prevent-ip-removal-on-bridge-release--bug-1792409 |
Merge into: | maas:master |
Diff against target: |
17 lines (+5/-1) 1 file modified
src/maasserver/models/node.py (+5/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alberto Donato (community) | Approve | ||
MAAS Lander | Approve | ||
Review via email: mp+357010@code.launchpad.net |
Commit message
LP #1792409 - Prevent removal of IP addresses when bridge interfaces are removed on release.
Description of the change
This was a strange race condition that seems to be related to the Django result cache - logging suggested that it was finding IP addresses attached to interfaces, when those IP addresses had been previously removed moments earlier.
Invalidating the cache didn't work, but we already had a workaround in the signal handler we could use to prevent the unwanted deletion of any IP addresses.
To post a comment you must log in.
Note: I couldn't find a good way to unit test this change, since it's a race condition that we don't see in that environment, and I can't access the same instance of the BridgeInterface to make sure it has the _skip_ip_ address_ removal attribute set.