diff mbox series

fetch2/wget: checkstatus: Do not try again on 404 status code

Message ID 20260811143212.2085885-1-rouven.rastetter.ext@karlstorz.com
State New
Headers show
Series fetch2/wget: checkstatus: Do not try again on 404 status code | expand

Commit Message

Rouven Rastetter Aug. 11, 2026, 2:32 p.m. UTC
Http status 404 means, the server send a valid answer. A retry should
not change the answer and unnecessarily slows down sstate cache
checking.
---
 lib/bb/fetch2/wget.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py
index 141c2d062..8a8d30ab3 100644
--- a/lib/bb/fetch2/wget.py
+++ b/lib/bb/fetch2/wget.py
@@ -421,7 +421,7 @@  class Wget(FetchMethod):
                 with opener.open(r, timeout=100) as response:
                     pass
             except (urllib.error.URLError, OSError, http.client.RemoteDisconnected) as e:
-                if try_again:
+                if try_again and getattr(e, 'code', None) != 404:
                     logger.debug2("checkstatus: trying again after exception %s" % str(e))
                     return self.checkstatus(fetch, ud, d, False)
                 else: