diff mbox series

[AUH,v2,2/9] upgrade-helper.py: Handle fetch errors gracefully during version scan

Message ID 20260424114603.2444938-3-daniel.turull@ericsson.com
State New
Headers show
Series upgrade_helper: scarthgap compatibility, stable updates and changelog extraction | expand

Commit Message

Daniel Turull April 24, 2026, 11:45 a.m. UTC
From: Daniel Turull <daniel.turull@ericsson.com>

Materialise the iterator from get_recipe_upgrade_status into a list,
catching any exception that terminates the iterator early. A single
unreachable upstream (e.g. git.savannah.gnu.org down) no longer
aborts the entire scan — the recipes collected so far are still
processed.

Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
Assisted-by: Claude, Anthropic
---
 upgrade-helper.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

Comments

Alexander Kanavin April 27, 2026, 9:37 a.m. UTC | #1
On Fri, 24 Apr 2026 at 13:46, <daniel.turull@ericsson.com> wrote:
> Materialise the iterator from get_recipe_upgrade_status into a list,
> catching any exception that terminates the iterator early. A single
> unreachable upstream (e.g. git.savannah.gnu.org down) no longer
> aborts the entire scan — the recipes collected so far are still
> processed.

I'd like to see the particular error that results in this happening
and fix it at the source. The get_recipe_upgrade_status() function is
not supposed to abort like this, and for any upstream network issues
it should be returning UNKNOWN_BROKEN status for that particular
recipe.

Alex
diff mbox series

Patch

diff --git a/upgrade-helper.py b/upgrade-helper.py
index aef7ed1..98391f3 100755
--- a/upgrade-helper.py
+++ b/upgrade-helper.py
@@ -711,7 +711,18 @@  class UniverseUpdater(Updater):
         upgrade_pkggroups = []
 
         for layer_name, layer_recipes in self.recipes:
-            pkggroups = oe.recipeutils.get_recipe_upgrade_status(layer_recipes)
+            pkggroups_iter = oe.recipeutils.get_recipe_upgrade_status(layer_recipes)
+
+            # Collect results, logging any fetch error that terminates
+            # the iterator early (oe-core raises inside executor.map,
+            # which cannot be resumed after an exception).
+            pkggroups = []
+            try:
+                for group in pkggroups_iter:
+                    pkggroups.append(group)
+            except Exception as e:
+                W(" Fetch error terminated recipe scan for layer %s: %s" %
+                  (layer_name, str(e)))
 
             for group in pkggroups: