From b42a3588445ee8b434a386fc8da55ca7cd548267 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 12 Nov 2020 09:44:17 +0100 Subject: [PATCH] Add workaround for connection timeouts --- .ci/README.md | 11 +++++++++++ .ci/build.sh | 3 +-- .github/workflows/pull-requests.yml | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.ci/README.md b/.ci/README.md index 3f8fc97477..505b59bff9 100644 --- a/.ci/README.md +++ b/.ci/README.md @@ -18,3 +18,14 @@ for a ssh key, which is used to copy files to sourceforge. gpg --batch --symmetric --cipher-algo AES256 --passphrase="$PMD_CI_SECRET_PASSPHRASE" file.txt +## Known Issues + +Intermittent build failures while downloading dependencies from maven central. +Root issue seems to be SNAT configs in Azure, which closes long running TCP connections +only on one side: https://docs.microsoft.com/en-us/azure/load-balancer/troubleshoot-outbound-connection#idletimeout +The default timeout is 4 minutes. + +Workaround as described in https://github.com/actions/virtual-environments/issues/1499 and +https://issues.apache.org/jira/browse/WAGON-545 is applied: + +`-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3` diff --git a/.ci/build.sh b/.ci/build.sh index 7ed79c10ec..712da3223c 100755 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -37,7 +37,6 @@ function pmd_ci_build_get_pom_version() { function pmd_ci_build_setup_maven() { # configure maven - echo "MAVEN_OPTS='-Xms1g -Xmx1g'" > ${HOME}/.mavenrc mkdir -p ${HOME}/.m2 cp .ci/maven-settings.xml ${HOME}/.m2/settings.xml } @@ -65,7 +64,7 @@ function pmd_ci_build_setup_oraclejdk7() { } function pmd_ci_build_run() { - MVN_BUILD_FLAGS="-B -V -Djava7.home=${HOME}/oraclejdk7" + MVN_BUILD_FLAGS="-e -Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3 -V -Djava7.home=${HOME}/oraclejdk7" log_info "This is a snapshot build" ./mvnw deploy -Possrh,sign $MVN_BUILD_FLAGS diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml index 8f75346792..023f1ac239 100644 --- a/.github/workflows/pull-requests.yml +++ b/.github/workflows/pull-requests.yml @@ -27,7 +27,7 @@ jobs: - name: Build with mvnw run: | source ${HOME}/java.env - ./mvnw -V clean install + ./mvnw -e -Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3 -V clean install shell: bash - name: Execute Danger if: ${{ runner.os == 'Linux' }}