← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1815871] [NEW] neutron-server api don't shutdown gracefully

 

Public bug reported:

When stop neutron-server, api worker will shutdown immediately no matter there are ongoing requests.
And the ongoing requests will abort immediately.

After testing, go through codes, compare with nova and cinder codes. 
The reason is that the stop and wait function in WorkerService in neutron/wsgi.py have issue.

    def wait(self):
        if isinstance(self._server, eventlet.greenthread.GreenThread):
            self._server.wait()

    def stop(self):
        if isinstance(self._server, eventlet.greenthread.GreenThread):
            self._server.kill()
            self._server = None

Check the neutron codes above.
After kill in stop function, self._server is forced to set to None, which makes nothing to do in wait function. This leads to api worker shutdown immediately without wait.

Nova has the correct logic, check: https://github.com/openstack/nova/blob/master/nova/wsgi.py#L197
Cinder use the oslo_service.wsgi, which has the same codes like nova.

** Affects: neutron
     Importance: Undecided
     Assignee: Jesse (jesse-5)
         Status: In Progress

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1815871

Title:
  neutron-server api don't shutdown gracefully

Status in neutron:
  In Progress

Bug description:
  When stop neutron-server, api worker will shutdown immediately no matter there are ongoing requests.
  And the ongoing requests will abort immediately.

  After testing, go through codes, compare with nova and cinder codes. 
  The reason is that the stop and wait function in WorkerService in neutron/wsgi.py have issue.

      def wait(self):
          if isinstance(self._server, eventlet.greenthread.GreenThread):
              self._server.wait()

      def stop(self):
          if isinstance(self._server, eventlet.greenthread.GreenThread):
              self._server.kill()
              self._server = None

  Check the neutron codes above.
  After kill in stop function, self._server is forced to set to None, which makes nothing to do in wait function. This leads to api worker shutdown immediately without wait.

  Nova has the correct logic, check: https://github.com/openstack/nova/blob/master/nova/wsgi.py#L197
  Cinder use the oslo_service.wsgi, which has the same codes like nova.

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


Follow ups