Skip to content

Commit b12a474

Browse files
d-fenceXavier-Do
authored andcommitted
[FIX] runbot: fix restore on temporary dns failures
From times to times, it happens that a host has a temporary dns failure causing the restore step to fail. With this commit, we add the `--retry-on-host-error` to the wget command which is designed for such a case. It will retry up to 20 times and will increase the waiting time between each time by one second up to 10 seconds.
1 parent 59fea0d commit b12a474

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

runbot/models/build_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ def _run_restore(self, build):
862862
cmd = ' && '.join([
863863
'mkdir /data/build/restore',
864864
'cd /data/build/restore',
865-
'wget %s' % dump_url,
865+
'wget --retry-on-host-error %s' % dump_url,
866866
'unzip -q %s' % zip_name,
867867
'echo "### restoring filestore"',
868868
'mkdir -p /data/build/datadir/filestore/%s' % restore_db_name,

runbot/tests/test_build_config_step.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def test_restore(self):
271271

272272
docker_params = self.restore_config_step._run_restore(dev_build)
273273
cmds = docker_params['cmd'].split(' && ')
274-
self.assertEqual(f'wget https://False/runbot/static/build/{reference_build.dest}/logs/{reference_build.dest}-suffix.zip', cmds[2])
274+
self.assertEqual(f'wget --retry-on-host-error https://False/runbot/static/build/{reference_build.dest}/logs/{reference_build.dest}-suffix.zip', cmds[2])
275275
self.assertEqual(f'psql -q {dev_build.dest}-suffix < dump.sql', cmds[8])
276276
self.called=True
277277

runbot/tests/test_upgrade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ def docker_run_restore(cmd, *args, **kwargs):
457457
[
458458
'mkdir /data/build/restore',
459459
'cd /data/build/restore',
460-
f'wget {dump_url}',
460+
f'wget --retry-on-host-error {dump_url}',
461461
f'unzip -q {zip_name}',
462462
'echo "### restoring filestore"',
463463
f'mkdir -p /data/build/datadir/filestore/{db_name}',

0 commit comments

Comments
 (0)