← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2120429] Re: Neutron FWaaS logapi fails to notify for already deleted ports

 

Reviewed:  https://review.opendev.org/c/openstack/neutron-fwaas/+/956013
Committed: https://opendev.org/openstack/neutron-fwaas/commit/6911bd07bc53c7137ab58c53c3330c3ccc8ba8cd
Submitter: "Zuul (22348)"
Branch:    master

commit 6911bd07bc53c7137ab58c53c3330c3ccc8ba8cd
Author: Sebastian Lohff <sebastian.lohff@xxxxxxx>
Date:   Mon Jul 28 14:24:51 2025 +0200

    Don't notify/access non-existent ports
    
    When calling need_to_notify() with a list of port ids where one port
    does not exist (could have been concurrently deleted) we'll get a None
    object and with that an AttributeError. To prevent this we skip
    notification checks for ports which we can't find in the database.
    
    Stacktrace without the fix:
    
    AttributeError: 'NoneType' object has no attribute 'get'
      File "neutron_lib/callbacks/manager.py", line 189, in _notify_loop
        callback.method(resource, event, trigger, payload=payload)
      File "neutron_fwaas/services/logapi/common/fwg_callback.py", line 43, in handle_event
        if self.need_to_notify(context, ports_delta):
      File "neutron_fwaas/services/logapi/common/fwg_callback.py", line 57, in need_to_notify
        device_owner = port.get('device_owner', '')
    
    Change-Id: I56256c776efec21ebb2a212085840bfbd03cfe50
    Closes-Bug: #2120429
    Signed-off-by: Sebastian Lohff <sebastian.lohff@xxxxxxx>


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/2120429

Title:
  Neutron FWaaS logapi fails to notify for already deleted ports

Status in neutron:
  Fix Released

Bug description:
  When handling port events inside fwaas, inside logapis
  need_to_notify() we might get a list of ports where some of the ports
  do not exist in the database anymore (maybe they already have been
  deleted?). For these ports we want to check if they actually exist
  before doing something with them.

  Without guarding against this we might end up with something like this
  every now and then:

  AttributeError: 'NoneType' object has no attribute 'get'
    File "neutron_lib/callbacks/manager.py", line 189, in _notify_loop
      callback.method(resource, event, trigger, payload=payload)
    File "neutron_fwaas/services/logapi/common/fwg_callback.py", line 43, in handle_event
      if self.need_to_notify(context, ports_delta):
    File "neutron_fwaas/services/logapi/common/fwg_callback.py", line 57, in need_to_notify
      device_owner = port.get('device_owner', ''

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/2120429/+subscriptions



References