← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1976292] Re: [OVN] AgentCache.agents can change during an iteration operation

 

Reviewed:  https://review.opendev.org/c/openstack/neutron/+/843933
Committed: https://opendev.org/openstack/neutron/commit/a71fe45d9628f0dc67ccd12d94a51a7b801ec9d0
Submitter: "Zuul (22348)"
Branch:    master

commit a71fe45d9628f0dc67ccd12d94a51a7b801ec9d0
Author: Rodolfo Alonso Hernandez <ralonsoh@xxxxxxxxxx>
Date:   Sun May 15 22:48:46 2022 +0000

    [OVN] Protect the AgentCache iteration by copying the local cache
    
    During the execution of ``AgentCache.__iter__``, the content of
    "self.agents" can change; the Neutron server can attend to an event
    to add or delete an OVN agent. If that happens, the iteration will
    fail with the error:
      "RuntimeError: dictionary changed size during iteration"
    
    To avoid this, before iterating the list of agents, the cache
    singleton creates a copy of the local cache. The aim of making this
    copy is to avoid using locks between threads.
    
    Closes-Bug: #1976292
    Change-Id: Icf92685579409282bad0a80ba42531c93738e0b1


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

Title:
  [OVN] AgentCache.agents can change during an iteration operation

Status in neutron:
  Fix Released

Bug description:
  Reference bugzilla:
  https://bugzilla.redhat.com/show_bug.cgi?id=2089420

  During the
  ``neutron.plugins.ml2.drivers.ovn.agent.neutron_agent.AgentCache.__iter__``
  iteration, an event to add or deleted an OVN agent can happen. The
  dictionary ``AgentCache.agents`` can change and trigger the error
  reported in the snippet.

  Snippet: https://paste.opendev.org/show/bWn8eKHKIjsWb4MM6pd2/

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



References