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

Cyclic references between objects should be forbidden #10189

Open
julianbrost opened this issue Oct 14, 2024 · 0 comments
Open

Cyclic references between objects should be forbidden #10189

julianbrost opened this issue Oct 14, 2024 · 0 comments
Labels
area/configuration DSL, parser, compiler, error handling

Comments

@julianbrost
Copy link
Contributor

In #10000 (comment), @yhabteab pointed out that configurations like the following are currently accepted by Icinga 2:

object HostGroup "foo" {
    groups = [ "bar" ]
}

object HostGroup "bar" {
    groups = [ "foo" ]
}
object TimePeriod "included" {
  excludes = ["excluded"]
  ranges = { "2024-10-14" = "14:00-15:00" }
}

object TimePeriod "excluded" {
  excludes = ["included"]
  ranges = { "2024-10-14" = "13:00-15:00" }
}

It's questionable if there would be valid use-cases for a configuration like this. Additionally, if cyclic dependencies are created using runtime updates, these objects may fail to synchronize as it's impossible to sort them properly if there are cycles1.

So at the moment, DependencyGraph (not to be confused with the Dependency config object type, DependencyGraph tracks config dependencies between all objects) may contain cycles, which could also be surprising.

Footnotes

  1. However, these object will not always fail to sync. There will be a problem if it's the initial sync of the object to the destination node. If an older version object already exists there, the incoming sync could update the object and introduce the cycle though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/configuration DSL, parser, compiler, error handling
Projects
None yet
Development

No branches or pull requests

1 participant