Skip to content

Commit

Permalink
IBDP: detect oscillation in OSPF (#6823)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhalperi committed Apr 1, 2021
1 parent 6d367c2 commit fd170a7
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,8 @@ static SortedMap<String, SortedMap<String, Set<AbstractRoute>>> getRoutes(
vrfEntry -> ImmutableSet.copyOf(vrfEntry.getValue().getRoutes())));
}

private static final int MAX_OSPF_INTERNAL_ITERATIONS = 100000;

/**
* Run the IGP OSPF computation until convergence.
*
Expand Down Expand Up @@ -868,6 +870,10 @@ private int initOspfInternalRoutes(Map<String, Node> allNodes, OspfTopology ospf
.flatMap(n -> n.getVirtualRouters().stream())
.flatMap(vr -> vr.getOspfProcesses().values().stream())
.anyMatch(OspfRoutingProcess::isDirty);
if (ospfInternalIterations > MAX_OSPF_INTERNAL_ITERATIONS) {
throw new BdpOscillationException(
"OSPF did not converge after " + MAX_OSPF_INTERNAL_ITERATIONS + " iterations");
}
} finally {
span.finish();
}
Expand Down

0 comments on commit fd170a7

Please sign in to comment.