Merge "[eventlet-removal] Removal of eventlet usage in this repository"

This commit is contained in:
Zuul
2025-09-16 14:06:57 +00:00
committed by Gerrit Code Review
7 changed files with 7 additions and 19 deletions

View File

View File

@@ -1,3 +0,0 @@
from neutron.common import eventlet_utils
eventlet_utils.monkey_patch()

View File

@@ -21,9 +21,9 @@ import re
import shutil
import socket
import sys
import time
import typing as ty
import eventlet
import jinja2
import netaddr
from neutron.agent.l3.router_info import RouterInfo
@@ -603,7 +603,7 @@ class OpenSwanProcess(BaseSwanProcess):
if not self._process_running():
self._cleanup_control_files()
break
eventlet.sleep(wait_interval)
time.sleep(wait_interval)
wait_interval *= cfg.CONF.pluto.shutdown_check_back_off
else:
LOG.warning('Server appears to still be running, restart '

View File

@@ -306,16 +306,6 @@ class TestIPSecBase(framework.L3AgentTestFramework):
# root_helper_daemon and instead use root_helper
# https://bugs.launchpad.net/neutron/+bug/1482622
cfg.CONF.set_override('root_helper_daemon', None, group='AGENT')
# Mock the method below because it causes Exception:
# RuntimeError: Second simultaneous read on fileno 5 detected.
# Unless you really know what you're doing, make sure that only
# one greenthread can read any particular socket. Consider using
# a pools.Pool. If you do know what you're doing and want to disable
# this error, call eventlet.debug.hub_prevent_multiple_readers(False)
# Can reproduce the exception in the test only
ip_lib.send_ip_addr_adv_notif = mock.Mock()
self.vpn_agent = vpn_agent.L3WithVPNaaS(self.conf)
self.driver = self.vpn_agent.device_drivers[0]
self.driver.agent_rpc.get_vpn_services_on_host = mock.Mock(

View File

@@ -17,6 +17,7 @@ import difflib
import io
import os
import socket
import time
from unittest import mock
import netaddr
@@ -1343,7 +1344,7 @@ class TestOpenSwanProcess(IPSecDeviceLegacy):
return_value=False)
@mock.patch('neutron_vpnaas.services.vpn.device_drivers.'
'ipsec.OpenSwanProcess._cleanup_control_files')
@mock.patch('eventlet.sleep')
@mock.patch.object(time, 'sleep')
def test_restart_process_not_running(self, sleep_mock, cleanup_mock,
query_mock, hop_mock):
self.process.restart()
@@ -1362,7 +1363,7 @@ class TestOpenSwanProcess(IPSecDeviceLegacy):
return_value=True)
@mock.patch('neutron_vpnaas.services.vpn.device_drivers.'
'ipsec.OpenSwanProcess._cleanup_control_files')
@mock.patch('eventlet.sleep')
@mock.patch.object(time, 'sleep')
def test_restart_process_doesnt_stop(self, sleep_mock, cleanup_mock,
query_mock, hop_mock):
self.process.restart()
@@ -1384,7 +1385,7 @@ class TestOpenSwanProcess(IPSecDeviceLegacy):
side_effect=[True, True, False, False])
@mock.patch('neutron_vpnaas.services.vpn.device_drivers.'
'ipsec.OpenSwanProcess._cleanup_control_files')
@mock.patch('eventlet.sleep')
@mock.patch.object(time, 'sleep')
def test_restart_process_retry_until_stop(self, sleep_mock, cleanup_mock,
query_mock, hop_mock):
self.process.restart()

View File

@@ -31,7 +31,7 @@ data_files =
[entry_points]
console_scripts =
neutron-vpn-netns-wrapper = neutron_vpnaas.services.vpn.common.netns_wrapper:main
neutron-ovn-vpn-agent = neutron_vpnaas.cmd.eventlet.ovn_agent:main
neutron-ovn-vpn-agent = neutron_vpnaas.cmd.ovn_agent:main
neutron.agent.l3.extensions =
vpnaas = neutron_vpnaas.services.vpn.agent:L3WithVPNaaS
device_drivers =