public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Oleg Obleukhov <leoleovich@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/oscillatord] rawhide: rebuild: retry every dropped Bodhi connection
Date: Fri, 13 Nov 2026 20:29:58 GMT	[thread overview]
Message-ID: <179460179802.1.673431373518960291.rpms-oscillatord-5d7833515e24@fedoraproject.org> (raw)

            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)

                 reply	other threads:[~2026-11-13 20:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179460179802.1.673431373518960291.rpms-oscillatord-5d7833515e24@fedoraproject.org \
    --to=leoleovich@fedoraproject.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox