Open
Description
Describe the bug
Since #6826 Downtime#HasValidConfigOwner()
doesn’t dispute config owner validity until all ScheduledDowntimes are loaded.
But if there aren’t any ScheduledDowntimes at all, HasValidConfigOwner returns always true and orphaned Downtimes are never deleted.
To Reproduce
- Create a checkable and apply a ScheduledDowntime to it
- Wait for the ScheduledDowntime to create a Downtime
- Remove all ScheduledDowntimes config
- Restart Icinga
- Wait for the Downtime to disappear (won’t happen)
Expected behavior
Downtime#HasValidConfigOwner()
doesn’t need any ScheduledDowntimes to be present to see that there aren’t any more of them to load.
Your Environment
Additional context
ref/IP/32533