public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/oscillatord] rawhide: rebuild: retry every dropped Bodhi connection
@ 2026-11-13 20:29 Oleg Obleukhov
  0 siblings, 0 replies; only message in thread
From: Oleg Obleukhov @ 2026-11-13 20:29 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/oscillatord
            Branch : rawhide
            Commit : 5d7833515e2435050d0d5ed4c46b18e29af46c01
            Author : Oleg Obleukhov <leoleovich@fedoraproject.org>
            Date   : 2026-11-13T20:28:18+00:00
            Stats  : +11/-2 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/oscillatord/c/5d7833515e2435050d0d5ed4c46b18e29af46c01?branch=rawhide

            Log:
            rebuild: retry every dropped Bodhi connection

Bodhi raised dropped connections three ways during the 2026-11-13 releases: as a raw requests ConnectionError from the Kerberos login, wrapped once, and wrapped twice (BodhiClientException from OIDCClientError from ConnectionError). Retry when a ConnectionError or Timeout appears anywhere in the chain; an HTTP error or a Bodhi rejection still fails at once.

[skip changelog]

---
diff --git a/rebuild/bodhi_helper.py b/rebuild/bodhi_helper.py
index 101c4a0..3511d43 100755
--- a/rebuild/bodhi_helper.py
+++ b/rebuild/bodhi_helper.py
@@ -33,6 +33,15 @@ def find(client, nvr):
     return None
 
 
+def _dropped(e):
+    # A connection Bodhi closed or timed out; its client may wrap it more than once.
+    while e is not None:
+        if isinstance(e, (requests.exceptions.ConnectionError, requests.exceptions.Timeout)):
+            return True
+        e = e.__context__
+    return False
+
+
 def ensure_update(client, notes, tag, nvr, attempts=6):
     # Bodhi drops connections now and then, and a create whose reply was dropped may still have gone through.
     for attempt in range(attempts):
@@ -53,8 +62,8 @@ def ensure_update(client, notes, tag, nvr, attempts=6):
                     unstable_karma=-3,
                 )
             return resp.get("updates", [resp])[0]["url"]
-        except (BodhiClientException, OIDCClientError) as e:
-            if not isinstance(e.__context__, requests.exceptions.RequestException) or attempt == attempts - 1:
+        except (BodhiClientException, OIDCClientError, requests.exceptions.RequestException) as e:
+            if not _dropped(e) or attempt == attempts - 1:
                 raise
             print(f"Bodhi dropped the connection ({e}), retrying", file=sys.stderr)
             time.sleep(15 * 2**attempt)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-13 20:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13 20:29 [rpms/oscillatord] rawhide: rebuild: retry every dropped Bodhi connection Oleg Obleukhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox