Merge pull request #6667 from Icinga/feature/dependency-recursion-limit

Increase dependency recursion limit to 256
This commit is contained in:
Michael Friedrich 2018-10-24 10:30:46 +02:00 committed by GitHub
commit c5e7459fb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -61,9 +61,12 @@ std::vector<Dependency::Ptr> Checkable::GetReverseDependencies() const
bool Checkable::IsReachable(DependencyType dt, Dependency::Ptr *failedDependency, int rstack) const
{
if (rstack > 20) {
/* Anything greater than 256 causes recursion bus errors. */
int limit = 256;
if (rstack > limit) {
Log(LogWarning, "Checkable")
<< "Too many nested dependencies for service '" << GetName() << "': Dependency failed.";
<< "Too many nested dependencies (>" << limit << ") for checkable '" << GetName() << "': Dependency failed.";
return false;
}