Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .kokoro/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ function retry_with_backoff {
shift 2
command=("$@")

# Add defensive timeouts to Maven commands to prevent Kokoro VM timeouts (10800s hang)
local mvn_regex='(^|/)mvnw?$'
if [[ "${command[0]:-}" =~ $mvn_regex ]]; then
if [[ "${MAVEN_OPTS:-}" != *"-Daether.connector.requestTimeout"* ]]; then
local -x MAVEN_OPTS="${MAVEN_OPTS:+"$MAVEN_OPTS "}-Daether.connector.requestTimeout=300000"
MAVEN_OPTS+=" -Daether.connector.connectTimeout=30000"
MAVEN_OPTS+=" -Dmaven.wagon.rto=300000"
MAVEN_OPTS+=" -Dmaven.wagon.connectionTimeout=30000"
MAVEN_OPTS+=" -Dmaven.wagon.http.retryHandler.class=standard"
MAVEN_OPTS+=" -Dmaven.wagon.http.retryHandler.count=3"
MAVEN_OPTS+=" -Dmaven.wagon.httpconnectionManager.ttlSeconds=120"
fi
fi
Comment thread
sakthivelmanii marked this conversation as resolved.
Resolved
Comment thread
sakthivelmanii marked this conversation as resolved.
Resolved

# store current flag state
flags=$-

Expand Down
Loading