mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
tests/functional: retry when seeing ConnectionError exception
This base class is used for many different socket connection errors, corresponding to ECONNRESET, ECONNREFUSED, ECONNABORTED and more. Most of these are things you might expect to see every now and then as transient flaws. We should thus retry the asset download when seeing them. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250918125746.1165658-2-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
committed by
Thomas Huth
parent
4f1ebc7712
commit
bcc251800b
@@ -179,6 +179,13 @@ class Asset:
|
||||
self.url, e.reason)
|
||||
raise AssetError(self, "Unable to download: URL error %s" %
|
||||
e.reason, transient=True)
|
||||
except ConnectionError as e:
|
||||
# A socket connection failure, such as dropped conn
|
||||
# or refused conn
|
||||
tmp_cache_file.unlink()
|
||||
self.log.error("Unable to download %s: Connection error %s",
|
||||
self.url, e)
|
||||
continue
|
||||
except Exception as e:
|
||||
tmp_cache_file.unlink()
|
||||
raise AssetError(self, "Unable to download: %s" % e)
|
||||
|
||||
Reference in New Issue
Block a user