Merge pull request #7090 from jladdjr/updates_to_same_inv_should_happen_serially

Updates to a given inventory should happen serially

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot]
2020-10-13 13:28:01 +00:00
committed by GitHub

View File

@@ -874,7 +874,6 @@ class Command(BaseCommand):
Load inventory from in-memory groups to the database, overwriting or Load inventory from in-memory groups to the database, overwriting or
merging as appropriate. merging as appropriate.
''' '''
with advisory_lock('inventory_{}_update'.format(self.inventory.id)):
# FIXME: Attribute changes to superuser? # FIXME: Attribute changes to superuser?
# Perform __in queries in batches (mainly for unit tests using SQLite). # Perform __in queries in batches (mainly for unit tests using SQLite).
self._batch_size = 500 self._batch_size = 500
@@ -998,6 +997,7 @@ class Command(BaseCommand):
raise CommandError('invalid regular expression for --host-filter') raise CommandError('invalid regular expression for --host-filter')
begin = time.time() begin = time.time()
with advisory_lock('inventory_{}_update'.format(self.inventory_id)):
self.load_inventory_from_database() self.load_inventory_from_database()
try: try: