Commit 86721d10 authored by Waleed Akbar's avatar Waleed Akbar
Browse files

feat: Improve connection removal handling by skipping connections not managed by the controller

parent 980da96a
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -862,8 +862,9 @@ class EventDispatcher(BaseEventDispatcher):
            mapping = self._object_cache.get(CachedEntities.CONNECTION, connection_uuid, auto_retrieve=False)
            
            if mapping is None:
                MSG = 'Connection {:s} not found in cache, cannot process removal (service may have restarted)'
                raise Exception(MSG.format(connection_uuid))
                MSG = 'Connection {:s} not managed by this controller (not in allowed links), skipping removal'
                LOGGER.debug(MSG.format(connection_uuid))
                return
            
            # Defensive: distinguish mapping dicts from potential protobuf Connection objects
            if not isinstance(mapping, dict) or 'domain' not in mapping or 'links' not in mapping: