← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1809497] Re: _get_filterid_for_ip can generate an UnboundLocalError

 

Reviewed:  https://review.openstack.org/630773
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=e788d294584add2407f601a46f90b08082cccc5f
Submitter: Zuul
Branch:    master

commit e788d294584add2407f601a46f90b08082cccc5f
Author: Slawek Kaplonski <skaplons@xxxxxxxxxx>
Date:   Mon Jan 14 22:29:25 2019 +0100

    Support iproute2 4.15 in l3_tc_lib
    
    In version 4.15 of iproute2 there was added support
    for chain index in tc_filter [1].
    Such version is available e.g. in Ubuntu 18.04 and it
    has to be supported in l3_tc_lib regex to match
    properly output of "tc filter" command.
    
    [1] https://lwn.net/Articles/745643/
    
    Closes-bug: #1809497
    Change-Id: Id4066b5cff933ccd0dd3c751bf67b5d58af662d1


** 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/1809497

Title:
  _get_filterid_for_ip can generate an UnboundLocalError

Status in neutron:
  Fix Released

Bug description:
  After fixing a bug in the L3 extension API,
  https://review.openstack.org/#/c/626401/ - the l3-agent is getting a
  traceback in the QoS code running the dvr multinode scenario job.

  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent [-] Failed to process compatible router: 7461a0e1-508c-4ff2-a559-6cc89a128ea5: UnboundLocalError: local variable 'filter_id' referenced before assignment
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent Traceback (most recent call last):
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent   File "/opt/stack/neutron/neutron/agent/l3/agent.py", line 628, in _process_routers_if_compatible
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent     self._process_router_if_compatible(router)
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent   File "/opt/stack/neutron/neutron/agent/l3/agent.py", line 504, in _process_router_if_compatible
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent     self._process_updated_router(router)
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent   File "/opt/stack/neutron/neutron/agent/l3/agent.py", line 529, in _process_updated_router
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent     self.l3_ext_manager.update_router(self.context, router)
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent   File "/opt/stack/neutron/neutron/agent/l3/l3_agent_extensions_manager.py", line 54, in update_router
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent     extension.obj.update_router(context, data)
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent   File "/usr/local/lib/python3.6/dist-packages/oslo_concurrency/lockutils.py", line 328, in inner
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent     return f(*args, **kwargs)
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent   File "/opt/stack/neutron/neutron/agent/l3/extensions/qos/fip.py", line 292, in update_router
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent     self.process_floating_ip_addresses(context, router_info)
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent   File "/opt/stack/neutron/neutron/agent/l3/extensions/qos/fip.py", line 277, in process_floating_ip_addresses
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent     self._remove_fip_rate_limit(device, fip)
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent   File "/opt/stack/neutron/neutron/agent/l3/extensions/qos/fip.py", line 164, in _remove_fip_rate_limit
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent     tc_wrapper.clear_ip_rate_limit(direction, fip_ip)
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent   File "/opt/stack/neutron/neutron/agent/linux/l3_tc_lib.py", line 188, in clear_ip_rate_limit
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent     filter_id = self._get_filterid_for_ip(qdisc_id, ip)
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent   File "/opt/stack/neutron/neutron/agent/linux/l3_tc_lib.py", line 82, in _get_filterid_for_ip
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent     filterids_for_ip.append(filter_id)
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent UnboundLocalError: local variable 'filter_id' referenced before assignment
  neutron-l3-agent[14973]: ERROR neutron.agent.l3.agent 

  From this log file:

  http://logs.openstack.org/01/626401/1/check/neutron-tempest-plugin-
  dvr-multinode-
  scenario/a7bcbe2/controller/logs/screen-q-l3.txt.gz?level=WARNING#_Dec_19_23_26_00_169583

  The loop in _get_filterid_for_ip() doesn't look to protect against
  this case, we'd need to capture the output to see why it's failing.

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


References