When SIGHUP signal is sent to cinder-api service, it doesn't complete
processing of all pending requests before terminating all the
processes.
This change is a copy of Abhishek Kekane's fix for nova api.
Change-Id: I049d2aa2f3ad1fe388e00213a71f374803ed409a
Closes-Bug: #
1334647
server.stop()
server.wait()
+ def test_server_pool_waitall(self):
+ # test pools waitall method gets called while stopping server
+ server = cinder.wsgi.Server("test_server", None,
+ host="127.0.0.1", port=4444)
+ server.start()
+ with mock.patch.object(server._pool,
+ 'waitall') as mock_waitall:
+ server.stop()
+ server.wait()
+ mock_waitall.assert_called_once_with()
+
def test_app(self):
greetings = 'Hello, World!!!'
"""
try:
if self._server is not None:
+ self._pool.waitall()
self._server.wait()
except greenlet.GreenletExit:
LOG.info(_("WSGI server has stopped."))