Skip to content

Commit

Permalink
Catch all exceptions in reinit phase
Browse files Browse the repository at this point in the history
In one customer setup, I noticed that ip-fabric network was deleted.
When schema transformer tried to delete the corresponding routing
instance, it got RefsExistError. We should log and ignore all error
during reinit phase to avoid such crashes.

Change-Id: I8b284ce24358d429ab2c766e2865bf66c5deb889
Closes-Bug: 1466153
  • Loading branch information
Sachin Bansal committed Jun 17, 2015
1 parent 73ee4d5 commit 77ec82f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/config/schema-transformer/to_bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2745,10 +2745,9 @@ def reinit(self):
if ri.parent_uuid not in vn_id_list:
delete = True
else:
ri_name = ri.get_fq_name()[-1]
# if the RI was for a service chain and service chain no
# longer exists, delete the RI
sc_id = VirtualNetworkST._get_service_id_from_ri(ri_name)
sc_id = VirtualNetworkST._get_service_id_from_ri(ri.name)
if sc_id and sc_id not in ServiceChain:
delete = True
else:
Expand All @@ -2759,6 +2758,11 @@ def reinit(self):
ri_obj.delete()
except NoIdError:
pass
except Exception as e:
_sandesh._logger.error(
"Error while deleting routing instance %s: %s",
ri.get_fq_name_str(), str(e))

# end for ri

sg_list = _vnc_lib.security_groups_list(detail=True,
Expand Down Expand Up @@ -2787,6 +2791,10 @@ def reinit(self):
_vnc_lib.access_control_list_delete(id=acl.uuid)
except NoIdError:
pass
except Exception as e:
_sandesh._logger.error(
"Error while deleting acl %s: %s",
acl.uuid, str(e))
# end for acl

gevent.sleep(0.001)
Expand Down

0 comments on commit 77ec82f

Please sign in to comment.