Nova api service doesn't handle SIGHUP properly

When SIGHUP signal is sent to nova-api service, it doesn't complete
processing of all pending requests before terminating all the
processes.

Closes-Bug: #1334647

Change-Id: I3f7bd0ba5ef1bb716a97635252abe251053a669d
(cherry picked from commit 224a3de466)
This commit is contained in:
abhishekkekane 2014-07-01 02:10:56 -07:00 committed by Yaguang Tang
parent 7cdb643cb3
commit f086ca3272
2 changed files with 13 additions and 0 deletions

View File

@ -22,6 +22,7 @@ import testtools
import eventlet
import eventlet.wsgi
import mock
import requests
import nova.exception
@ -126,6 +127,17 @@ class TestWSGIServer(test.NoDBTestCase):
server.stop()
server.wait()
def test_server_pool_waitall(self):
# test pools waitall method gets called while stopping server
server = nova.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_uri_length_limit(self):
server = nova.wsgi.Server("test_uri_length_limit", None,
host="127.0.0.1", max_url_len=16384)

View File

@ -237,6 +237,7 @@ class Server(object):
"""
try:
if self._server is not None:
self._pool.waitall()
self._server.wait()
except greenlet.GreenletExit:
LOG.info(_("WSGI server has stopped."))