From 36764524689b9290219eb406a4dca5b6db9ce311 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Fri, 25 Aug 2023 09:44:56 -0400 Subject: [PATCH] Sort image rpm components before inserting Related: https://pagure.io/koji/issue/3637 A potential fix for a rare deadlock. This is the same thing we do in BuildRoot._setList() --- kojihub/kojihub.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kojihub/kojihub.py b/kojihub/kojihub.py index 775cb5d0..b821e162 100644 --- a/kojihub/kojihub.py +++ b/kojihub/kojihub.py @@ -10069,6 +10069,8 @@ def importImageInternal(task_id, build_info, imgdata): else: data = get_rpm(an_rpm, strict=True) rpm_ids.append(data['id']) + # we sort to try to avoid deadlock issues + rpm_ids.sort() # associate those RPMs with the image insert = BulkInsertProcessor('archive_rpm_components')