Skip to content

Commit 671c7b4

Browse files
committed
Limit time to copy hot cache artifact from network volume to 120sec
... to ensure no time is wasted due to a slow, overloaded or hanging network drive. CMK-31471 Change-Id: I358058afcea7505545329c351aa862a5680ab8d6 (cherry picked from commit c9a20e3)
1 parent ab7bc00 commit 671c7b4

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

buildscripts/scripts/utils/upload_artifacts.groovy

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,25 @@ void clean_caches() {
150150

151151
boolean download_hot_cache(Map args) {
152152
try {
153-
sh("""
154-
mkdir -p ${args.download_dest}
155-
cp ${env.PERSISTENT_K8S_VOLUME_PATH}/${args.file_pattern}{${hashfile_extension},} ${args.download_dest}
156-
""");
153+
// average runtime of this part is up to 60sec when transfering a 11GB linter archive
154+
timeout(time: 120, unit: 'SECONDS') {
155+
sh("""
156+
mkdir -p ${args.download_dest}
157+
cp ${env.PERSISTENT_K8S_VOLUME_PATH}/${args.file_pattern}{${hashfile_extension},} ${args.download_dest}
158+
""");
159+
}
160+
} catch (Exception exc) {
161+
println("hot cache: Warning - ran into exception while copying artifact from network volume: ${exc}");
162+
return true;
163+
}
157164

165+
try {
158166
if (!is_hash_verified("${args.download_dest}/${args.file_pattern}")) {
159167
raise("The sha256sum of the downloaded file does not match the expectation");
160168
}
161169
}
162170
catch (Exception exc) {
163-
print("hot cache: ran into exception while running download_hot_cache() for ${args.file_pattern}: ${exc}");
171+
print("hot cache: ran into exception while verifying artifact integrity of ${args.file_pattern}: ${exc}");
164172
return true;
165173
}
166174

0 commit comments

Comments
 (0)