Skip to content

Commit

Permalink
Gracefully handle duplicate delete requests.
Browse files Browse the repository at this point in the history
This code change is to handle any gracefully handle duplicate delete requests
sent by external entities, in this case service monitor.
This code change will log and handle the key not found excpetion and proceed.

The service monitor, sending  duplicate deletes is tracked by bug: 1636932

Change-Id: I606561ca0e3c570713b41c196325180a16f96987
closes-bug: #1635901
  • Loading branch information
dineshb-jnpr committed Oct 31, 2016
1 parent d414e34 commit f10daf7
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/config/api-server/vnc_cfg_ifmap.py
Expand Up @@ -633,13 +633,24 @@ def _delete_id_self_meta(self, self_imid, meta_name):
True)
self._publish_to_ifmap_enqueue('delete', del_str)

# del meta from cache and del id if this was last meta
if meta_name:
del self._id_to_metas[self_imid][meta_name]
if not self._id_to_metas[self_imid]:
try:

# del meta from cache and del id if this was last meta
if meta_name:
del self._id_to_metas[self_imid][meta_name]
if not self._id_to_metas[self_imid]:
del self._id_to_metas[self_imid]
else:
del self._id_to_metas[self_imid]
else:
del self._id_to_metas[self_imid]

except KeyError:
# Case of delete received for an id which we do not know about.
# Could be a case of duplicate delete.
# There is nothing for us to do here. Just log and proceed.
msg = "Delete received for unknown imid(%s) meta_name(%s)." % \
(self_imid, meta_name)
self.config_log(msg, level=SandeshLevel.SYS_DEBUG)

# end _delete_id_self_meta

def _delete_id_pair_meta_list(self, id1, meta_list):
Expand Down

0 comments on commit f10daf7

Please sign in to comment.