Skip to content

Commit

Permalink
Merge pull request #21034 from AdamBrousseau/no_gc_aix_master
Browse files Browse the repository at this point in the history
Skip git gc on aix and master/built-in
  • Loading branch information
pshipton authored Jan 28, 2025
2 parents 5fd874e + 69e740a commit 28c9282
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions buildenv/jenkins/jobs/infrastructure/Update-Reference-Repos.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,20 @@ timeout(time: 6, unit: 'HOURS') {
continue
}

def gc = true
def sNodeName = sNode.getDisplayName()
if (!sNode.toComputer().name) {
sNodeName = builtInLabel
// Do not gc on aix or master. Seems to be problematic #20346
gc = false
}

setupNodesNames.add(sNodeName)

jobs["${sNodeName}"] = {
node("${sNodeName}") {
stage("${sNodeName} - Update Reference Repo") {
refresh(sNodeName, get_cache_dir(), defaultRepos, true)
refresh(sNodeName, get_cache_dir(), defaultRepos, true, gc)
}
}
}
Expand Down Expand Up @@ -155,10 +158,15 @@ timeout(time: 6, unit: 'HOURS') {
// Remove any dups
repos.unique()

def gc = true
if (nodeLabels.contains('sw.os.aix')) {
// Do not gc on aix or master. Seems to be problematic #20346
gc = false
}
jobs["${nodeName}"] = {
node("${nodeName}") {
stage("${nodeName} - Update Reference Repo") {
refresh(nodeName, get_cache_dir(), repos, foundLabel)
refresh(nodeName, get_cache_dir(), repos, foundLabel, gc)
}
}
}
Expand Down Expand Up @@ -186,7 +194,7 @@ timeout(time: 6, unit: 'HOURS') {
/*
* Creates and updates the git reference repository cache on the node.
*/
def refresh(node, cacheDir, repos, isKnownOs) {
def refresh(node, cacheDir, repos, isKnownOs, gc) {
if (CLEAN_CACHE_DIR) {
sh "rm -fr ${cacheDir}"
}
Expand All @@ -207,8 +215,10 @@ def refresh(node, cacheDir, repos, isKnownOs) {
sh "git fetch --all"
}
}
stage("${node} - GC Repo") {
sh "git gc --aggressive --prune=all"
if (gc) {
stage("${node} - GC Repo") {
sh "git gc --aggressive --prune=all"
}
}
}
}
Expand Down

0 comments on commit 28c9282

Please sign in to comment.