1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-18 05:18:24 +02:00

Adds retry mechanism for JNLP4-connect issues in unstash function (#3030)

* Adds retry mechanism for JNLP4-connect issues in unstash function

* Bugfix

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
This commit is contained in:
ffeldmann 2021-08-10 15:11:38 +02:00 committed by GitHub
parent 1ddd966249
commit 11f927caee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,6 +86,17 @@ def unstash(name, msg = "Unstash failed:") {
unstashedContent += name unstashedContent += name
} catch (e) { } catch (e) {
echo "$msg $name (${e.getMessage()})" echo "$msg $name (${e.getMessage()})"
if (e.getMessage().contains("JNLP4-connect")) {
sleep(3000) // Wait 3 seconds in case it has been a network hiccup
try {
echo "[Retry JNLP4-connect issue] Unstashing content: ${name}"
steps.unstash name
unstashedContent += name
} catch (errRetry) {
msg = "[Retry JNLP4-connect issue] Unstashing failed:"
echo "$msg $name (${errRetry.getMessage()})"
}
}
} }
return unstashedContent return unstashedContent
} }