[
https://issues.apache.org/jira/browse/KNOX-2639?focusedWorklogId=630504&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-630504
]
ASF GitHub Bot logged work on KNOX-2639:
----------------------------------------
Author: ASF GitHub Bot
Created on: 28/Jul/21 13:18
Start Date: 28/Jul/21 13:18
Worklog Time Spent: 10m
Work Description: zeroflag opened a new pull request #475:
URL: https://github.com/apache/knox/pull/475
## What changes were proposed in this pull request?
Trying to get rid of build instability errors like this:
```
Error: Failed to execute goal on project gateway-test-release: Could not
resolve dependencies for project
org.apache.knox:gateway-test-release:pom:1.6.0-SNAPSHOT: Failed to collect
dependencies at org.eclipse.jetty:jetty-util-ajax:jar:9.4.34.v20201102: Failed
to read artifact descriptor for
org.eclipse.jetty:jetty-util-ajax:jar:9.4.34.v20201102:
Could not transfer artifact
org.eclipse.jetty:jetty-util-ajax:pom:9.4.34.v20201102 from/to central
(https://repo.maven.apache.org/maven2): transfer failed for
https://repo.maven.apache.org/maven2/org/eclipse/jetty/jetty-util-ajax/9.4.34.v20201102/jetty-util-ajax-9.4.34.v20201102.pom:
Connection timed out (Read failed) -> [Help 1]
```
There is a `maven.wagon.http.retryHandler.count` parameter but it doesn't do
anything by default because ConnectException is not retryable by default, so I
had to set maven.wagon.http.retryHandler.nonRetryableClasses as well.
This way I can see the retry related messages in the mvn outout.
Many sources recommened `-Dhttp.keepAlive=false` because keepAlive
connections are prone to be killed within docker for some reason.
## How was this patch tested?
1.) Enable maven wagon logging to see retries:
```
org.slf4j.simpleLogger.log.org.apache.maven.wagon.providers.http.httpclient=on
in
~/tools/apache-maven-3.8.1/conf/logging/simplelogger.properties
```
2.) Simulate Connection Timeout by setting `10.255.255.1
repo.maven.apache.org` in `/etc/hosts`
3.) Run maven command with retry and checked the output:
```
mvn -Dmaven.wagon.http.retryHandler.count=2
-Dmaven.wagon.http.retryHandler.class=default
-Dmaven.wagon.http.retryHandler.nonRetryableClasses=java.io.InterruptedIOException
-DskipTests -Dcheckstyle.skip=true -Dfindbugs.skip=true -Dpmd.skip=true
-Drat.skip -Ppackage clean install
```
Output:
```
Downloading from central:
https://repo.maven.apache.org/maven2/org/apache/velocity/velocity/1.5/velocity-1.5.pom
[INFO] I/O exception
(org.apache.maven.wagon.providers.http.httpclient.conn.HttpHostConnectException)
caught when processing request to {s}->https://repo.maven.apache.org:443:
Connect to repo.maven.apache.org:443 [repo.maven.apache.org/10.255.255.1]
failed: Operation timed out (Connection timed out)
[INFO] Retrying request to {s}->https://repo.maven.apache.org:443
[INFO] I/O exception
(org.apache.maven.wagon.providers.http.httpclient.conn.HttpHostConnectException)
caught when processing request to {s}->https://repo.maven.apache.org:443:
Connect to repo.maven.apache.org:443 [repo.maven.apache.org/10.255.255.1]
failed: Operation timed out (Connection timed out)
[INFO] Retrying request to {s}->https://repo.maven.apache.org:443
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 630504)
Remaining Estimate: 0h
Time Spent: 10m
> Build instability because maven artifact download failure
> ---------------------------------------------------------
>
> Key: KNOX-2639
> URL: https://issues.apache.org/jira/browse/KNOX-2639
> Project: Apache Knox
> Issue Type: Task
> Components: Build
> Reporter: Attila Magyar
> Assignee: Attila Magyar
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Travis often fails because of a maven dependency download issue:
> {code:java}
> Error: Failed to execute goal on project gateway-test-release: Could not
> resolve dependencies for project
> org.apache.knox:gateway-test-release:pom:1.6.0-SNAPSHOT: Failed to collect
> dependencies at org.eclipse.jetty:jetty-util-ajax:jar:9.4.34.v20201102:
> Failed to read artifact descriptor for
> org.eclipse.jetty:jetty-util-ajax:jar:9.4.34.v20201102: Could not transfer
> artifact org.eclipse.jetty:jetty-util-ajax:pom:9.4.34.v20201102 from/to
> central (https://repo.maven.apache.org/maven2): transfer failed for
> https://repo.maven.apache.org/maven2/org/eclipse/jetty/jetty-util-ajax/9.4.34.v20201102/jetty-util-ajax-9.4.34.v20201102.pom:
> Connection timed out (Read failed) -> [Help 1]
> {code}
> Let's try fixing this by adding some retry logic.
> {code:java}
> -Dmaven.wagon.http.retryHandler.count=5{code}
> If it doesn't work we might need to add some shell script to do the retry.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)