Glance was not supporting uwsgi deployment when we added periodic job
to prefetch images into cache. Later in ussuri uwsgi support was added
but we missed to implement periodic job to pre-cache the image.
This patch add this support for glance + uwsgi. For WSGI, we run the
prefetcher with an external lock, which makes sure that multiple API
workers will not attempt to cache an image at the same time. In this
case, if multiple workers attempt to run at the same time, only one
will grab the lock and do the work. When completed, the other worker
will grab the lock and either find all the work completed, or complete
new work that has been queued since the first one started.
Closes-Bug: #1939307
Co-Authored-By: Dan Smith <email address hidden>
Change-Id: I2abd1e60f414fbd68ce84e0b280f8b3e4e791a82
Reviewed: https:/ /review. opendev. org/c/openstack /glance/ +/803937 /opendev. org/openstack/ glance/ commit/ 9b385f7b671fd99 94d416949ebd10c 424d9fc072
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 9b385f7b671fd99 94d416949ebd10c 424d9fc072
Author: Abhishek Kekane <email address hidden>
Date: Mon Aug 9 07:00:54 2021 +0000
[uwsgi] Add missing pefetch periodic job
Glance was not supporting uwsgi deployment when we added periodic job
to prefetch images into cache. Later in ussuri uwsgi support was added
but we missed to implement periodic job to pre-cache the image.
This patch add this support for glance + uwsgi. For WSGI, we run the
prefetcher with an external lock, which makes sure that multiple API
workers will not attempt to cache an image at the same time. In this
case, if multiple workers attempt to run at the same time, only one
will grab the lock and do the work. When completed, the other worker
will grab the lock and either find all the work completed, or complete
new work that has been queued since the first one started.
Closes-Bug: #1939307 d68ce84e0b280f8 b3e4e791a82
Co-Authored-By: Dan Smith <email address hidden>
Change-Id: I2abd1e60f414fb