← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1912359] Re: [OVN] Add support for WSGI mod

 

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

commit cfab008eef3d11055ad16b8dd0d49aaa1801bc95
Author: Rodolfo Alonso Hernandez <ralonsoh@xxxxxxxxxx>
Date:   Fri Jun 21 12:39:24 2024 +0000

    [OVN] Enable the WSGI module for the OVN mechanism driver
    
    This patch enables the use of the WSGI module with the ML2/OVN
    mechanism driver. The ML2/OVN requires two events that are called
    during the Neutron eventlet server initialization:
    * BEFORE_SPAWN: called once before the API workers have been created
      and after the ML2 plugin code has been initalizated.
    * AFTER_INIT: called when the API worker is started; at this point
      the different worker processes have been spawned.
    
    The WSGI module didn't make these event calls. Now these events are
    called during the API server initialization, after the ML2 plugin
    has been initalizated but before the server is running and attending
    any request.
    
    This approach differs from the Neutron eventlet server event calls
    because the BEFORE_SPAWN event is called for all API workers; that
    means the method ``OVNMechanismDriver.pre_fork_initialize`` is called
    as many times as workers are configured.
    
    Closes-Bug: #1912359
    Change-Id: I684c6cea620308a6617b665400ce608650a2adfd


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

Title:
  [OVN] Add support for WSGI mod

Status in neutron:
  Fix Released

Bug description:
  Currently the OVN driver initialization does not work with uWSGI
  because the initialization is different than eventlet and the
  post_fork_initialization() method [0] does not get called in the
  process.

  The post_fork_initialization() method is the one responsible for a few
  things:

  * Starting the OVN database connections
  * Starting the maintenance task
  * Overwriting the agent and availability zone methods for OVN use [1]
  * Running the database synchronization script (in log or repair mode) [2]

  These steps would need to be factored out to adhere to the uWSGI
  initialization process.

  [0]
  https://github.com/openstack/neutron/blob/19de0598227e2156b26f6d5eca874eaba09106a7/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py#L181-L186

  [1]
  https://github.com/openstack/neutron/blob/19de0598227e2156b26f6d5eca874eaba09106a7/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py#L284-L292

  [2]
  https://github.com/openstack/neutron/blob/19de0598227e2156b26f6d5eca874eaba09106a7/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py#L300-L315

  
  How to reproduce:

  Deploy Devstack with OVN
  (https://docs.openstack.org/neutron/latest/contributor/testing/ovn_devstack.html)
  with NEUTRON_DEPLOY_MOD_WSGI=True set in local.conf.

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



References