diff --git a/openstack/python-glance-store/centos/meta_patches/0004-meta-Add-glance-schedulre-greenthreads.patch b/openstack/python-glance-store/centos/meta_patches/0004-meta-Add-glance-schedulre-greenthreads.patch new file mode 100644 index 00000000..5302f7ac --- /dev/null +++ b/openstack/python-glance-store/centos/meta_patches/0004-meta-Add-glance-schedulre-greenthreads.patch @@ -0,0 +1,32 @@ +From fc9b9d397b503eeff6585310d8de177b051a11e9 Mon Sep 17 00:00:00 2001 +From: Elena Taivan +Date: Wed, 6 Jun 2018 10:02:56 +0000 +Subject: [PATCH 1/1] meta Add glance schedulre greenthreads + +--- + SPECS/python-glance-store.spec | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/SPECS/python-glance-store.spec b/SPECS/python-glance-store.spec +index 0c0d728..977b2bc 100644 +--- a/SPECS/python-glance-store.spec ++++ b/SPECS/python-glance-store.spec +@@ -16,6 +16,7 @@ Source0: https://tarballs.openstack.org/%{upstream_name}/%{upstream_name} + # WRS + Patch0001: 0001-Check-ceph-cluster-free-space-before-creating-image.patch + Patch0002: 0002-Add-glance-driver.patch ++Patch0003: 0003-Add-glance-schedule-greenthreads.patch + + BuildArch: noarch + +@@ -90,6 +91,7 @@ Requires: python3-oslo-privsep >= 1.9.0 + # Apply WRS patches + %patch0001 -p1 + %patch0002 -p1 ++%patch0003 -p1 + + %build + %py2_build +-- +1.8.3.1 + diff --git a/openstack/python-glance-store/centos/meta_patches/PATCH_ORDER b/openstack/python-glance-store/centos/meta_patches/PATCH_ORDER index f63468e9..e0858259 100644 --- a/openstack/python-glance-store/centos/meta_patches/PATCH_ORDER +++ b/openstack/python-glance-store/centos/meta_patches/PATCH_ORDER @@ -1,3 +1,4 @@ 0001-Update-package-versioning-for-TIS-format.patch 0002-meta-patch-Check-ceph-cluster-free-space.patch 0003-meta-patch-Glance-Driver.patch +0004-meta-Add-glance-schedulre-greenthreads.patch diff --git a/openstack/python-glance-store/centos/patches/0003-Add-glance-schedule-greenthreads.patch b/openstack/python-glance-store/centos/patches/0003-Add-glance-schedule-greenthreads.patch new file mode 100644 index 00000000..8d443e48 --- /dev/null +++ b/openstack/python-glance-store/centos/patches/0003-Add-glance-schedule-greenthreads.patch @@ -0,0 +1,33 @@ +From 71f9d9555e0909cbc878d8852cd2c2243abd0b1c Mon Sep 17 00:00:00 2001 +From: Elena Taivan +Date: Wed, 6 Jun 2018 09:41:42 +0000 +Subject: [PATCH 1/1] Add glance schedule greenthreads + +--- + glance_store/_drivers/filesystem.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/glance_store/_drivers/filesystem.py b/glance_store/_drivers/filesystem.py +index 5de011d..4a26d10 100644 +--- a/glance_store/_drivers/filesystem.py ++++ b/glance_store/_drivers/filesystem.py +@@ -23,6 +23,7 @@ import hashlib + import logging + import os + import stat ++import time + + import jsonschema + from oslo_config import cfg +@@ -685,6 +686,8 @@ class Store(glance_store.driver.Store): + if verifier: + verifier.update(buf) + f.write(buf) ++ # Give other greenthreads a chance to schedule. ++ time.sleep(0) + except IOError as e: + if e.errno != errno.EACCES: + self._delete_partial(filepath, image_id) +-- +1.8.3.1 +