Skip to content

Put running downtimes in effect and merge segments#1

Open
efuss wants to merge 7 commits intomasterfrom
fix/scheduleddowntime
Open

Put running downtimes in effect and merge segments#1
efuss wants to merge 7 commits intomasterfrom
fix/scheduleddowntime

Conversation

@efuss
Copy link
Copy Markdown
Owner

@efuss efuss commented Aug 29, 2018

Put an already running downtime in effect immediately:
If Icinga2 was restarted with a newly configured downtime that should
be in effect at the time of restart, the should-be-running segment of
it was not put into effect.

Merge adjacent downtime segments:
As legacy time periods can't span midnight, a configured downtime
spanning midnight is technically two (immediately adjecent) segments.
As segments were queued individually, at midnight, the downtime
technically ended (sending a DowntimeEnd) only to start immediately
again (sending a DowntimeStart notification).
With this fix, an immediately following segment is merged into the
current one in case the current one is ending soon (where "soon" is
defined as "12 hours or less"). The time limit is arbitrary, but
necessary to prevent endless merging in case of a 7*24 downtime.

Note that the diff of scheduleddowntime.cpp looks weird because it
inserts a new FindRunningSegment() function in front of FindNextSegment()
and the initial lines of bot functions look sufficiently similar to make
diff believe FindNextSegment() got changed.

efuss added 7 commits August 29, 2018 18:46
Put running downtimes in effect and merge segments

Put an already running downtime in effect immediately:
If Icinga2 was restarted with a newly configured downtime that should
be in effect at the time of restart, the should-be-running segment of
it was not put into effect.

Merge adjacent downtime segments:
As legacy time periods can't span midnight, a configured downtime
spanning midnight is technically two (immediately adjecent) segments.
As segments were queued individually, at midnight, the downtime
technically ended (sending a DowntimeEnd) only to start immediately
again (sending a DowntimeStart notification). 
With this fix, an immediately following segment is merged into the
current one in case the current one is ending soon (where "soon" is
defined as "12 hours or less"). The time limit is arbitrary, but
necessary to prevent endless merging in case of a 7*24 downtime.
In ScheduledDowntime::FindRunningSegment(), only regard downtimes that last longer than minEnd, not at least as long.
Otherwise, a running downtime with a fixed start date will be queued over and over again.
Revert commit 406e5f2 as the patched file was from the wrong branch
In ScheduledDowntime::FindRunningSegment(), only regard downtimes that last longer than minEnd, not at least as long.
Otherwise, a running downtime with a fixed start date will be queued over and over again.
Revert commit 2e721ba since it put scheduleddowntime.cpp in the wrong place.
In ScheduledDowntime::FindRunningSegment(), only regard downtimes that last longer than minEnd, not at least as long.
Otherwise, a running downtime with a fixed start date will be queued over and over again.
Surpress a mislading debug message stating the next segment won't fit because its start time (The Epoch) didn't match. Instead, log that no next segment exists.
efuss pushed a commit that referenced this pull request Jan 15, 2021
Introduce Endpoint#icinga_version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant