| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| Glance | Fix Released | Undecided | Unassigned | ||
The wsgi_app.py file in the tree allows operators to run Glance API as a proper WSGI app. This has been the default devstack deployment for some time and multiple real clouds in the wild deploy like this. However, an attempt to start an import will be met with an image state of "queued" forever and no tasks will ever start, run, or complete.
(note that this has been a known issue and the Glance team prescribes running standalone eventlet-based glance-api for deployments that need import to work).

| OpenStack Infra (hudson-openstack) wrote:Fix merged to glance (master) | #1 |
Reviewed:https:/
Committed:https:/
Submitter: Zuul
Branch: master
commit 16a5431c665adad
Author: Dan Smith <email address hidden>
Date: Mon Jul 20 20:49:34 2020 -0700
Make glance-api able to do async tasks in WSGI mode
This teaches glance-api how to do async threading things when it is
running in pure-WSGI mode. In order to do that, a refactoring of things
that currently depend on eventlet is required.
It adds a [wsgi]/
in the case of pure-WSGI and native threads to constrain the number
of threads in that pool (and thus the task parallelism). This will
allow tuning by the operator, but also lets us default that to just
a single thread in the backport of these fixes so that we can avoid
introducing a new larger footprint in the backport unexpectedly.
Partial-Bug: #1888713
Depends-On:https:/
Change-Id: Ie15028b75fb851

| OpenStack Infra (hudson-openstack) wrote: | #2 |
Reviewed:https:/
Committed:https:/
Submitter: Zuul
Branch: master
commit 783fa72f481d689
Author: Dan Smith <email address hidden>
Date: Tue Jul 21 16:25:40 2020 -0700
Make image conversion use a proper python interpreter for prlimit
The image conversion plugin does a processutils exec(), which needs
to spawn python for prlimit support. Under uwsgi, sys.executable
points to uwsgi itself, which won't work in this case. This introduces
a [wsgi]/
there is any way to get this from uwsgi itself) which we use for
the exec. By default, it's sys.executable, which is what is used
right now so nobody should notice a change unless they need it.
Note: Making this depend on the devstack change to remove the wsgi
import restriction so we can get a test on it.
Partial-Bug: #1888713
Change-Id: I7cb2e135d6ea2c
| Changed in glance: | |
| status: | In Progress → Fix Released |

| OpenStack Infra (hudson-openstack) wrote: | #3 |
Reviewed:https:/
Committed:https:/
Submitter: Zuul
Branch: master
commit f4b78606bafd0c1
Author: Dan Smith <email address hidden>
Date: Wed Jul 22 10:03:58 2020 -0700
Make wsgi_app support graceful shutdown
This makes us wait for all running threads in the tasks_pool threadpool
before exiting. Tested with uwsgi via devstack, with a long-running
image conversion task. Indeed, uwsgi triggers a graceful shutdown, we
wait for the remaining thread, and then exit when the conversion has
completed.
Closes-Bug: #1888713
Change-Id: I0cec7771ab8ce4
Bug watches keep track of this bug in other bug trackers.