-
Notifications
You must be signed in to change notification settings - Fork 573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't fail to remove obsolete downtimes #10062
Conversation
81aec89
to
438aa6d
Compare
Before[2024-05-16 12:17:00 +0200] debug/ApiListener: Sent update for object 'downtime-test!99532ab9-66fd-4625-881c-1e71acfc3dab': {"config":"object Downtime \"99532ab9-66fd-4625-881c-1e71acfc3dab\" ignore_on_error {\n\tauthor = \"icingaadmin\"\n\tauthoritative_zone = \"master\"\n\tcomment = \"Scheduled downtime by me\"\n\tconfig_owner = \"downtime-test!backup-downtime\"\n\tconfig_owner_hash = \"f15ba79d61f3f10cc45e03469760c8609a808e752b691dcfd798551ba8069091\"\n\tduration = 7200.000000\n\tend_time = 1716220800.000000\n\tentry_time = 1715854620.401736\n\tfixed = true\n\thost_name = \"downtime-test\"\n\tparent = \"\"\n\tscheduled_by = \"downtime-test!backup-downtime\"\n\tstart_time = 1716202800.000000\n\ttriggered_by = \"\"\n\tversion = 1715854620.401923\n\tzone = \"master\"\n}\n","modified_attributes":{},"name":"downtime-test!99532ab9-66fd-4625-881c-1e71acfc3dab","original_attributes":[],"type":"Downtime","version":1715854620.401923,"zone":"master"}
[2024-05-16 12:17:00 +0200] information/ConfigObjectUtility: Created and activated object 'downtime-test!99532ab9-66fd-4625-881c-1e71acfc3dab' of type 'Downtime'.
[2024-05-16 12:17:00 +0200] notice/ApiListener: Relaying 'config::UpdateObject' message
[2024-05-16 12:17:00 +0200] notice/WorkQueue: Stopped WorkQueue threads for 'ConfigObjectUtility::CreateObject'
[2024-05-16 12:17:00 +0200] information/Downtime: Added downtime 'downtime-test!99532ab9-66fd-4625-881c-1e71acfc3dab' between '2024-05-20 13:00:00' and '2024-05-20 18:00:00', author: 'icingaadmin', fixed
[2024-05-16 12:17:00 +0200] critical/ScheduledDowntime: Exception occurred during removal of obsolete downtime for scheduled downtime 'downtime-test!backup-downtime': Error: Cannot remove downtime 'downtime-test!baa2338e-34b0-44a1-94fa-c24f9b1f2b0a'. It is owned by scheduled downtime object 'downtime-test!backup-downtime' After[2024-05-16 12:19:53 +0200] debug/ApiListener: Sent delete for object 'downtime-test!99532ab9-66fd-4625-881c-1e71acfc3dab': {"name":"downtime-test!99532ab9-66fd-4625-881c-1e71acfc3dab","type":"Downtime","version":1715854620.401923}
[2024-05-16 12:19:53 +0200] information/ConfigObjectUtility: Deleted object 'downtime-test!99532ab9-66fd-4625-881c-1e71acfc3dab' of type 'Downtime'.
[2024-05-16 12:19:53 +0200] information/Downtime: Removed downtime 'downtime-test!99532ab9-66fd-4625-881c-1e71acfc3dab' from checkable 'downtime-test' (Reason: cancelled by 'downtime-test!backup-downtime' of type 'ScheduledDowntime').
[2024-05-16 12:19:53 +0200] debug/ApiListener: Sent delete for object 'downtime-test!baa2338e-34b0-44a1-94fa-c24f9b1f2b0a': {"name":"downtime-test!baa2338e-34b0-44a1-94fa-c24f9b1f2b0a","type":"Downtime","version":1715785930.19472}
[2024-05-16 12:19:53 +0200] information/ConfigObjectUtility: Deleted object 'downtime-test!baa2338e-34b0-44a1-94fa-c24f9b1f2b0a' of type 'Downtime'.
[2024-05-16 12:19:53 +0200] information/Downtime: Removed downtime 'downtime-test!baa2338e-34b0-44a1-94fa-c24f9b1f2b0a' from checkable 'downtime-test' (Reason: cancelled by 'downtime-test!backup-downtime' of type 'ScheduledDowntime'). |
438aa6d
to
f9ae1d5
Compare
f9ae1d5
to
f4256eb
Compare
f4256eb
to
c0e458b
Compare
Sorry! I had to revert a change from feeeded because the origin for the removed child downtimes should be the current endpoint and not some other passed ones. |
And why exactly? |
Because the object deletion event for these child downtimes |
lib/icinga/downtime.cpp
Outdated
if (cancelled) { | ||
downtime->SetRemovalInfo(removedBy, Utility::GetTime()); | ||
if (removalReason != DowntimeExpired) { | ||
downtime->SetRemovalInfo(removedBy, Utility::GetTime(), origin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we omit ALL the origin passthrough additions for now and discuss them separately?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem! Downtime::RemoveDowntime()
is never called from outside with the origin
param set anyway, so I am wondering why it was introduced in the first place.
c0e458b
to
81a94a0
Compare
Before
See #10042
After
ScheduledDowntime
object via the APIfixes #10042