Skip to content

Commit 5dad7b8

Browse files
committed
contest: remote: fetcher: ignore bad fetches
We keep having issues with DNS. Ignore transient failures to fetch the branch list. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 6a9b9a5 commit 5dad7b8

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

contest/remote/lib/fetcher.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(self, cb, cbarg, name, branches_url, results_path, url_path, tree_p
3333
pass
3434
elif first_run == "continue":
3535
try:
36-
r = requests.get(self._branches_url)
36+
r = requests.get(self._branches_url, timeout=30)
3737
branches = json.loads(r.content.decode('utf-8'))
3838
branch_date = {}
3939
for b in branches:
@@ -131,7 +131,12 @@ def _find_branch(self, name):
131131
return branches[0]
132132

133133
def _run_once(self):
134-
r = requests.get(self._branches_url)
134+
try:
135+
r = requests.get(self._branches_url, timeout=30)
136+
except requests.exceptions.RequestException as e:
137+
print(f'WARN: Failed to fetch branches: {e}')
138+
return
139+
135140
branches = json.loads(r.content.decode('utf-8'))
136141

137142
to_test = None

0 commit comments

Comments
 (0)