Skip to content

Commit ed576ab

Browse files
MagicRBMic92
authored andcommitted
Rip out retries
Signed-off-by: magic_rb <[email protected]>
1 parent 85a4c63 commit ed576ab

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

buildbot_nix/__init__.py

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import multiprocessing
55
import os
66
import re
7-
import uuid
87
from collections import defaultdict
98
from collections.abc import Generator
109
from dataclasses import dataclass
@@ -631,24 +630,6 @@ def run(self) -> Generator[Any, object, Any]:
631630
return result
632631

633632

634-
# FIXME this leaks memory... but probably not enough that we care
635-
class RetryCounter:
636-
def __init__(self, retries: int) -> None:
637-
self.builds: dict[uuid.UUID, int] = defaultdict(lambda: retries)
638-
639-
def retry_build(self, build_id: uuid.UUID) -> int:
640-
retries = self.builds[build_id]
641-
if retries > 1:
642-
self.builds[build_id] = retries - 1
643-
return retries
644-
return 0
645-
646-
647-
# For now we limit this to two. Often this allows us to make the error log
648-
# shorter because we won't see the logs for all previous succeeded builds
649-
RETRY_COUNTER = RetryCounter(retries=2)
650-
651-
652633
class EvalErrorStep(steps.BuildStep):
653634
"""Shows the error message of a failed evaluation."""
654635

@@ -694,9 +675,8 @@ def run(self) -> Generator[Any, object, int]:
694675
class NixBuildCommand(buildstep.ShellMixin, steps.BuildStep):
695676
"""Builds a nix derivation."""
696677

697-
def __init__(self, retries: int, **kwargs: Any) -> None:
678+
def __init__(self, **kwargs: Any) -> None:
698679
kwargs = self.setupShellMixin(kwargs)
699-
self.retries = retries
700680
super().__init__(**kwargs)
701681

702682
@defer.inlineCallbacks
@@ -706,10 +686,6 @@ def run(self) -> Generator[Any, object, Any]:
706686
yield self.runCommand(cmd)
707687

708688
res = cmd.results()
709-
if res == util.FAILURE and self.retries > 0:
710-
retries = RETRY_COUNTER.retry_build(self.getProperty("build_uuid"))
711-
if retries > self.retries - 1:
712-
return util.RETRY
713689
return res
714690

715691

@@ -903,7 +879,6 @@ def nix_build_config(
903879
worker_names: list[str],
904880
post_build_steps: list[steps.BuildStep],
905881
outputs_path: Path | None = None,
906-
retries: int = 1,
907882
) -> BuilderConfig:
908883
"""Builds one nix flake attribute."""
909884
factory = util.BuildFactory()
@@ -929,7 +904,6 @@ def nix_build_config(
929904
# 3 hours, defaults to 20 minutes
930905
# We increase this over the default since the build output might end up in a different `nix build`.
931906
timeout=60 * 60 * 3,
932-
retries=retries,
933907
haltOnFailure=True,
934908
),
935909
)
@@ -1146,7 +1120,6 @@ def config_for_project(
11461120
post_build_steps: list[steps.BuildStep],
11471121
job_report_limit: int | None,
11481122
outputs_path: Path | None = None,
1149-
build_retries: int = 1,
11501123
) -> None:
11511124
config["projects"].append(Project(project.name))
11521125
config["schedulers"].extend(
@@ -1244,7 +1217,6 @@ def config_for_project(
12441217
project,
12451218
worker_names,
12461219
outputs_path=outputs_path,
1247-
retries=build_retries,
12481220
post_build_steps=post_build_steps,
12491221
),
12501222
nix_skipped_build_config(project, [SKIPPED_BUILDER_NAME]),
@@ -1459,7 +1431,6 @@ def configure(self, config: dict[str, Any]) -> None:
14591431
[x.to_buildstep() for x in self.config.post_build_steps],
14601432
self.config.job_report_limit,
14611433
self.config.outputs_path,
1462-
self.config.build_retries,
14631434
)
14641435

14651436
config["workers"].append(worker.LocalWorker(SKIPPED_BUILDER_NAME))

0 commit comments

Comments
 (0)