Skip to content

Commit

Permalink
Nova api service doesn't handle SIGHUP properly
Browse files Browse the repository at this point in the history
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 224a3de)
  • Loading branch information
abhishekkekane authored and Yaguang Tang committed Oct 21, 2014
1 parent 7cdb643 commit f086ca3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions nova/tests/test_wsgi.py
Expand Up @@ -22,6 +22,7 @@

import eventlet
import eventlet.wsgi
import mock
import requests

import nova.exception
Expand Down Expand Up @@ -126,6 +127,17 @@ def test_start_random_port_with_ipv6(self):
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)
Expand Down
1 change: 1 addition & 0 deletions nova/wsgi.py
Expand Up @@ -237,6 +237,7 @@ def wait(self):
"""
try:
if self._server is not None:
self._pool.waitall()
self._server.wait()
except greenlet.GreenletExit:
LOG.info(_("WSGI server has stopped."))
Expand Down

0 comments on commit f086ca3

Please sign in to comment.