Handle more than 1 level of resolution in PathResolver
The code didn't previously handle the scenario where a BgpRoute with
one or more resolved paths is itself used to resolve ResolverPaths.
This scenario caused a concurrency issue wherein one partition was
attempting to modify a BgpRoute (by adding/deleting resolved paths)
while another partition was trying to access the same BgpRoute (to
get the BgpPaths to use as nexthops).
Fix by introducing a read-write mutex in the ResolverRouteState to
serialize access to the corresponding BgpRoute. Take a write lock
on the ResolverRouteState for the BgpRoute being modified and a read
lock on the ResolverRouteState for the BgpRoute to the nexthop.
Reviewed: https:/ /review. opencontrail. org/25185 github. org/Juniper/ contrail- controller/ commit/ a6be0b0377e617c af2e24f59db57d7 edc0ec28be
Committed: http://
Submitter: Zuul
Branch: R3.2
commit a6be0b0377e617c af2e24f59db57d7 edc0ec28be
Author: Nischal Sheth <email address hidden>
Date: Mon Oct 10 11:43:16 2016 -0700
Handle more than 1 level of resolution in PathResolver
The code didn't previously handle the scenario where a BgpRoute with
one or more resolved paths is itself used to resolve ResolverPaths.
This scenario caused a concurrency issue wherein one partition was
attempting to modify a BgpRoute (by adding/deleting resolved paths)
while another partition was trying to access the same BgpRoute (to
get the BgpPaths to use as nexthops).
Fix by introducing a read-write mutex in the ResolverRouteState to
serialize access to the corresponding BgpRoute. Take a write lock
on the ResolverRouteState for the BgpRoute being modified and a read
lock on the ResolverRouteState for the BgpRoute to the nexthop.
Change-Id: I485e197ee92d4b a2347d136fecaec 29b0c068b65
Closes-Bug: 1622618