Stop the API so rescue can exit and succeed

The change in frameworks with the API changed the overall execution
behavior from single threaded serialized execution threaded to
multithreaded through eventlet.

But we signaled ourselves to wait for the API to stop, but never
actually stopped the API.

As setting the flag to stop the API is a hard notification that
the API must now exit, there is no reason to wait and block exit,
hence the simple nature of this change.

Now the threads should exit, IPA should exit, and rescue should
ideally work.

Change-Id: I3faf2d169d4edac6a2321f8649bb9ce478885ea1
Story: 2006998
Task: 37768
This commit is contained in:
Julia Kreger 2019-12-07 09:45:32 -08:00
parent 33fa473551
commit 8aa9b79c46

View File

@ -139,9 +139,10 @@ class Application(object):
def stop(self):
"""Stop the API service."""
LOG.debug("Stopping the API service.")
if self.service is None:
return
self.service.wait()
self.service.stop()
self.service = None
LOG.info('Stopped API service on port %s', self.PORT)