Skip to content
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

Remove downtimes when objects are deactivated. #10311

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

w1ll-i-code
Copy link

Fixes #10303.

Copy link

cla-bot bot commented Jan 21, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: William Calliari.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@w1ll-i-code w1ll-i-code force-pushed the 10303-downtime-on-removed-object-never-closed branch from 3f209d7 to df2146d Compare January 21, 2025 14:05
@cla-bot cla-bot bot added the cla/signed label Jan 21, 2025
@yhabteab
Copy link
Member

Hi, sorry for the delay!

However, this PR will not solve the problem described in #10303. The problem is caused by an Icinga Director deployment and a Director deployment means that the entire process is replaced by a new one with its own configuration. It is like removing an object Service "foo" { ... from one of the conf files and then reloading Icinga 2, and in such cases there will be no deletion event for this service. If that service has had some downtime assigned to it, then they are simply dangling objects from that moment on and Icinga 2 will not be able to load them, so they will simply be silently deleted. In order to fix this, major refactoring and design changes are required, so it's not something that's easy to fix, as already outlined in #10303 (comment).

What this PR is trying to do is already done here (although the variable name parents is confusing, it should actually be children). When you remove a service via the API, all of its children, including downtime, are automatically removed.

for (auto& parentObj : parents) {
DeleteObjectHelper(parentObj, cascade, errors, diagnosticInformation, cookie);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Downtime on a removed object are never closed.
2 participants