nova-api should shutdown gracefully
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Wishlist
|
Marian Horban | ||
oslo-incubator |
Won't Fix
|
Wishlist
|
Unassigned | ||
oslo.service |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
In IceHouse, An awesome feature got implemented: graceful shutdown nova service, which can make sure in-process RPC request got done before kill the process.
But nova-api not support graceful shutdown now, which can cause problem when do upgrading. For example, when a request to create an instance was in-progress, kill the nova-api may lead to quota not sync or odd database records. Especially in large-scale development, there are hundreds of request in a second, kill the nova-api will interrupt lots in-process greenlet.
In nova/wsgi.py, when stoping WSGI service, we first shrink the greenlet pool size to 0, then kill the eventlet wsgi server. The work around is quick and easy: wait for all greenlets in the pool to finish, then kill wsgi server. The code looks like below:
diff --git a/nova/wsgi.py b/nova/wsgi.py
index ba52872..3c89297 100644
--- a/nova/wsgi.py
+++ b/nova/wsgi.py
@@ -212,6 +212,9 @@ class Server(object):
if self._server is not None:
# Resize pool to stop new requests from being processed
+ num = self._pool.
+ LOG.info(_("Waiting WSGI server to finish %d requests." % num))
+ self._pool.
def wait(self):
tags: | added: icehouse-backport-potential juno-backport-potential |
tags: | added: quotas |
Changed in nova: | |
importance: | Undecided → Wishlist |
Changed in nova: | |
assignee: | nobody → Davanum Srinivas (DIMS) (dims-v) |
status: | Confirmed → In Progress |
Changed in nova: | |
assignee: | Davanum Srinivas (DIMS) (dims-v) → Marian Horban (mhorban) |
Changed in oslo.service: | |
status: | New → Confirmed |
Changed in nova: | |
status: | In Progress → Fix Committed |
Changed in nova: | |
milestone: | none → liberty-3 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | liberty-3 → 12.0.0 |
Changed in oslo-incubator: | |
status: | Confirmed → Won't Fix |
Fix proposed to branch: master /review. openstack. org/129167
Review: https:/