From a6fae8d3a07f17b35ac06266c96467ae1d62df39 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sun, 10 Mar 2024 17:34:22 +0100 Subject: [PATCH] remove retry logic retries don't help us very much, in fact they mostly hurt by repeating builds that failed for non-transient reasons. retries could help with workers dropping while running a build, but those rare cases are better to restart manually than to pend at least twice the ci time for commits that simply do not build cleanly. --- buildbot_nix/__init__.py | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/buildbot_nix/__init__.py b/buildbot_nix/__init__.py index 2f50695..a2d8775 100644 --- a/buildbot_nix/__init__.py +++ b/buildbot_nix/__init__.py @@ -192,24 +192,6 @@ class NixEvalCommand(buildstep.ShellMixin, steps.BuildStep): return result -# FIXME this leaks memory... but probably not enough that we care -class RetryCounter: - def __init__(self, retries: int) -> None: - self.builds: dict[uuid.UUID, int] = defaultdict(lambda: retries) - - def retry_build(self, build_id: uuid.UUID) -> int: - retries = self.builds[build_id] - if retries > 1: - self.builds[build_id] = retries - 1 - return retries - return 0 - - -# For now we limit this to two. Often this allows us to make the error log -# shorter because we won't see the logs for all previous succeeded builds -RETRY_COUNTER = RetryCounter(retries=2) - - class EvalErrorStep(steps.BuildStep): """Shows the error message of a failed evaluation.""" @@ -236,12 +218,7 @@ class NixBuildCommand(buildstep.ShellMixin, steps.BuildStep): cmd: remotecommand.RemoteCommand = yield self.makeRemoteShellCommand() yield self.runCommand(cmd) - res = cmd.results() - if res == util.FAILURE: - retries = RETRY_COUNTER.retry_build(self.getProperty("build_uuid")) - if retries > 0: - return util.RETRY - return res + return cmd.results() class UpdateBuildOutput(steps.BuildStep):