Put running downtimes in effect and merge segments#1
Open
Conversation
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.
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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.