-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue 6231][Build] Configure maven http connection pool setting and maven http retry setting in Github Flows #8386
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea.
But it would be better to apply this change to mvn invocation in github actions files.
If we commit this file the change will apply to every local environment and to other CI systems (for people who test Pulsar on their own CI systems)
It seems like the setting |
Documentation for It mentions "Any retry handler can only react to exceptions when executing the request and receiving the response head. It will not salvage in-flight failures of ongoing response body streams." . It seems that it won't be useful for retrying downloads. |
@eolivelli Eventually I will go with this proposal, so that the settings apply only for github actions. It turns out that |
1377e6c
to
5781f66
Compare
There is an issue https://issues.apache.org/jira/browse/WAGON-486 , besides disabling the connection pool completely, it would be possible to tweak the |
Fixes apache#6231 Maven's wagon-http documentation: https://maven.apache.org/wagon/wagon-providers/wagon-http/ Set maven.wagon.httpconnectionManager.ttlSeconds to 25 seconds. maven.wagon.httpconnectionManager.ttlSeconds documentation in source code: https://github.com/apache/maven-wagon/blob/a7c8e3470dd968961e87a7cb9a3829d3bec77383/wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java#L297-L305 Also add -Dmaven.wagon.http.retryHandler.count=3 which will retry http calls 3 times. However this has no impact on retrying downloads. (documentatation: "Any retry handler can only react to exceptions when executing the request and receiving the response head. It will not salvage in-flight failures of ongoing response body streams.")
5781f66
to
3caa9cc
Compare
I also found https://issues.apache.org/jira/browse/WAGON-545 which is a close match to the issue we are having. |
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@lhotari I see the same problem in BookKeeper repository
do you mind porting this PR to Apache BooKeeper repository as well ? |
@eolivelli sure, I can do that. It's apache/bookkeeper#2460 . |
/pulsarbot run-failure-checks |
2 similar comments
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
btw. Github Actions / Flows do run on Azure.
|
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
Actually, I just now noticed yet another connection reset when using Perhaps we need to switch to |
### Motivation Fixes "Transfer failed for https://repo.maven.apache.org/... .jar: Connection reset" type of failures in Github Flows environment such as ``` Error: Failed to execute goal on project bookkeeper-common: Could not resolve dependencies for project org.apache.bookkeeper:bookkeeper-common:jar:4.12.0-SNAPSHOT: Could not transfer artifact org.jctools:jctools-core:jar:2.1.2 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/jctools/jctools-core/2.1.2/jctools-core-2.1.2.jar: Connection reset -> [Help 1] ``` ### Changes Set `maven.wagon.httpconnectionManager.ttlSeconds` to 25 seconds. Besides this, set `maven.wagon.http.retryHandler.count` to 3 retries. https://issues.apache.org/jira/browse/WAGON-545 contains a recommendation "Azure users shall set the TTL to 240 seconds or less." The reason for the 25 second TTL is to ensure that it's shorter than any common firewall or NAT timeout. Some NATs have a 30 second idle timeout although that is very rare. There shouldn't be harm in using the 25 second TTL since the connection pool will be able to pool connections well with a 25 second TTL. The documentation for `maven.wagon.httpconnectionManager.ttlSeconds` is available in the source code: https://github.com/apache/maven-wagon/blob/wagon-3.4.1/wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java#L297-L305 Documentation for `maven.wagon.http.retryHandler.count` is in https://maven.apache.org/wagon/wagon-providers/wagon-http/ "Any retry handler can only react to exceptions when executing the request and receiving the response head. It will not salvage in-flight failures of ongoing response body streams." Therefore the retry count setting is a bit different than expected. WAGON-545 explains that ConnectionExceptions aren't part of the retried exceptions by default. If such issues become problems, it's possible to configure the retry handler in a more fine grained way. This is similar to the change made in Pulsar: apache/pulsar#8386
Fixes apache#6231 Maven's wagon-http documentation: https://maven.apache.org/wagon/wagon-providers/wagon-http/ Set maven.wagon.httpconnectionManager.ttlSeconds to 25 seconds. maven.wagon.httpconnectionManager.ttlSeconds documentation in source code: https://github.com/apache/maven-wagon/blob/a7c8e3470dd968961e87a7cb9a3829d3bec77383/wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java#L297-L305 Also add -Dmaven.wagon.http.retryHandler.count=3 which will retry http calls 3 times. However this has no impact on retrying downloads. (documentatation: "Any retry handler can only react to exceptions when executing the request and receiving the response head. It will not salvage in-flight failures of ongoing response body streams.")
Fixes apache#6231 Maven's wagon-http documentation: https://maven.apache.org/wagon/wagon-providers/wagon-http/ Set maven.wagon.httpconnectionManager.ttlSeconds to 25 seconds. maven.wagon.httpconnectionManager.ttlSeconds documentation in source code: https://github.com/apache/maven-wagon/blob/a7c8e3470dd968961e87a7cb9a3829d3bec77383/wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java#L297-L305 Also add -Dmaven.wagon.http.retryHandler.count=3 which will retry http calls 3 times. However this has no impact on retrying downloads. (documentatation: "Any retry handler can only react to exceptions when executing the request and receiving the response head. It will not salvage in-flight failures of ongoing response body streams.")
…" issues - previously the http connection pooling timeout was reduced to 25 seconds in PR apache#8386. However the issue has persisted. The mitigation used in other projects is to disable maven's http connection pooling completely. The solution is proposed here: - actions/runner-images#1499 (comment)
…" issues - previously the http connection pooling timeout was reduced to 25 seconds in PR apache#8386. However the issue has persisted. The mitigation used in other projects is to disable maven's http connection pooling completely. The solution is proposed here: - actions/runner-images#1499 (comment)
…" issues (#8921) ### Motivation PR #8386 configured the http connection pooling timeout to 25 seconds. However the "connection reset" issue with maven dependency downloads has persisted. he mitigation used in other projects is to disable maven's http connection pooling completely. The solution is proposed here: - actions/runner-images#1499 (comment) ### Modifications Disable maven's http connection pool by passing `-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false` in `MAVEN_OPTS` environment variable.
Fixes #6231
Motivation
See #6231 . This is a common problem in Pulsar CI running on Github Actions.
Modifications
MAVEN_OPTS
to-Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3
in Github Flows environment.
This will set the http connection pool TTL to 25 seconds. In addition, http requests will be retried 3 times.
https://issues.apache.org/jira/browse/WAGON-545 is a close match to the issue #6231 .
In the last comment, it says "Azure users shall set the TTL to 240 seconds or less."