add option to disable retry on transient build failure
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- build-system, ci-cd
Research direction
Start in src/hydra-queue-runner/build-remote.cc at the BuildResult::TransientFailure branch shown in the issue. Verify how the derivation environment is read and confirm that __hydraRetry=false stops retries after the first transient failure while the default behavior remains unchanged.
Written by the indexing model from the issue text.
Description
When Nix returns BuildResult::TransientFailure, Hydra retries the build many times with exponential back-off. This is appropriate when the derivation is simply downloading from the internet, but Nix actually returns this error code quite liberally, and it does it systematically for fixed-output and impure derivations when they fail.
This behavior is sometimes very unwelcome; for example, I am using dedicated fixed-output derivations to run additional, complex tests that involve hardware-in-the-loop and Windows VMs.
The simple patch below allows retries to be disabled for particular derivations in this manner:
foo = pkgs.stdenv.mkDerivation {
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "...";
__hydraRetry = false;
...
}
When the build of that derivation fails, Hydra immediately marks it as failed after the first attempt.
commit cbdd0167ac1dbd1bfb96a7d7cdeefe01af8599cd (HEAD -> patched-npm, origin/patched-npm)
Author: Sebastien Bourdeauducq <sb@m-labs.hk>
Date: Thu Mar 14 17:45:32 2019 +0800
add option to disable retries on transient failures
diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc
index 69c430eb..bdbc808d 100644
--- a/src/hydra-queue-runner/build-remote.cc
+++ b/src/hydra-queue-runner/build-remote.cc
@@ -344,7 +344,7 @@ void State::buildRemote(ref<Store> destStore,
break;
case BuildResult::TransientFailure:
result.stepStatus = bsFailed;
- result.canRetry = true;
+ result.canRetry = get(step->drv.env, "__hydraRetry", "1") == "1";
result.errorMsg = "";
break;
case BuildResult::TimedOut:
- Dominant language
- PLpgSQL
- Stars
- 1.6k
- Forks
- 358
- Avg merge
- 20h 30m
- Merged PRs (30d)
- 27
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NixOS/hydra
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
Similar issues
-
Needs Design Priority: Wishlist
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
elementary/flatpak-platform#253 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
objectionary/hone-maven-plugin#1060 ·
-
0.kind: build failure
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Update Vish to 1.1.5 Openpackage-update
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
oSoWoSo/vOid_Community_repOsitory#144 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100