Browse Source

Yield control to other greenthreads while processing trusted ports

process_trusted_ports() appeared to be greenthread unfriendly, so
if there are many trusted ports on a node, openvswitch agent may
"hang" for a significant time.
This patch adds explicit yield.

Change-Id: I7c00812f877e2fc966bbac3060e1187ce1b809ca
Closes-Bug: #1836023
(cherry picked from commit da539da378)
changes/00/670500/1
Oleg Bondarev 2 months ago
parent
commit
639f5788bf
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      neutron/agent/linux/openvswitch_firewall/firewall.py

+ 3
- 0
neutron/agent/linux/openvswitch_firewall/firewall.py View File

@@ -17,6 +17,7 @@ import collections
17 17
 import contextlib
18 18
 import copy
19 19
 
20
+import eventlet
20 21
 import netaddr
21 22
 from neutron_lib.callbacks import events as callbacks_events
22 23
 from neutron_lib.callbacks import registry as callbacks_registry
@@ -658,6 +659,8 @@ class OVSFirewallDriver(firewall.FirewallDriver):
658 659
         """Pass packets from these ports directly to ingress pipeline."""
659 660
         for port_id in port_ids:
660 661
             self._initialize_egress_no_port_security(port_id)
662
+            # yield to let other greenthreads proceed
663
+            eventlet.sleep(0)
661 664
 
662 665
     def remove_trusted_ports(self, port_ids):
663 666
         for port_id in port_ids:

Loading…
Cancel
Save