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:
parent
7cdb643cb3
commit
f086ca3272
|
@ -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)
|
||||
|
|
|
@ -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."))
|
||||
|
|
Loading…
Reference in New Issue