Juniper/contrail-controller — pull request #559 by nischalsheth (2014-04-08 01:08:49+00:00)
Title: Handle case where RoutingInstance is deleted when processing subscribe.

Previously we would go ahead and process the subscribe even if routing
instance was marked deleted. Some of the tables in the instance may
already have been deleted. This would obviously cause problems later
since the agent wouldn't really have been subscribed per the membership
manager.

Fix is to add instance to the vrf membership request map and process it
as a deferred subscription request when the instance gets created later.

Also take care of the case where we get an unsubscribe when the instance
is marked deleted. If the instance is not in the vrf membership request
map, we process the unsubscribe as normal. Otherwise we just remove it
from the vrf membership request map and flush any entries on the DeferQ.

Add tests to recreate the issue and verify the fix.