Skip to content

Commit

Permalink
Static route task instance
Browse files Browse the repository at this point in the history
Root cause:

StaticRoute task runs with instance ID of rtinstance->index() which allows
multiple static route tasks to run in parallel.

There are 3 major issues related to this concurrency
1. StaticRoute task adds/deletes/updates routes to DBtable. So concurrent tasks
could potentially operate on same DBTablePartition. Possibly corrupt the chagne_list

2. RemoveStaticRouteMgr called on BgpServer object corrupts the srt_manager_list_

3. Concurrent call to BgpConditionListener::UnregisterMatchCondition can corrupt
the condition listener datastructure.(TableMap map_).

Proposed Fix:

Run static route task with instance of 0.
Also, note that task policy of control-node ensures that
   1. DBTable task and staticRoute task doesn't run in parallel.
   2. bgp:Config task and StaticRoute tasks are mutually exclusive

Change-Id: Ib5ee4060ea90947a8261f33fa194219205702163
Closes-Bug: 1547178
  • Loading branch information
bailkeri committed Mar 2, 2016
1 parent 2efe77a commit 2dc582a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bgp/routing-instance/static_route.cc
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ StaticRouteMgr::StaticRouteMgr(RoutingInstance *instance)
}

static_route_queue_ = new WorkQueue<StaticRouteRequest *>
(static_route_task_id_, routing_instance()->index(),
(static_route_task_id_, 0,
boost::bind(&StaticRouteMgr::StaticRouteEventCallback, this, _1));
}

Expand Down

0 comments on commit 2dc582a

Please sign in to comment.