Skip to content
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

chore(build): Decrease Maven Wagon Connection Pool TTL #3012

Merged
merged 1 commit into from
Feb 22, 2023

Conversation

jerrinot
Copy link
Contributor

@jerrinot jerrinot commented Feb 22, 2023

This is meant to deal with the "connection reset" problem when downloading artifacts from Maven Central.

Facts:

  1. Builds are running in Azure Pipelines
  2. Builds have the JDK HTTP pooling disabled via -Dhttp.keepAlive=false
  3. Builds are still frequently failing with "Connection Reset"
  4. The errors happen right after running Core tests

Hypothesis:

  1. Maven has its own connection pooling system as documented at https://issues.apache.org/jira/browse/WAGON-545 So even when JDK pooling is disabled there is still a pool on a higher level.

  2. Azure infra kills idle TCP connections while tests are running

  3. When Core tests are finished Maven starts building the Benchmark module. The Benchmark module uses a different Maven Clean plugin version -> Maven wants to download this version by using a connection from its pool. When this connection happens to be killed by Azure then Maven fails to download the clean plugin -> Build Error

Assuming the hypothesis above is correct then decreasing TTL on connection in the Maven pool should eliminate the errors. In fact, it's documented at https://issues.apache.org/jira/browse/WAGON-545?focusedCommentId=16755035&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-16755035

Azure users shall set the TTL to 240 seconds or less.

If just decreasing TTL won't help then the next step is to disable the Maven pool entirely.

This is meant to deal with the "connection reset" problem
when downloading artifacts from Maven Central.

Facts:
1. Builds are running in Azure Pipelines
2. Builds have the JDK HTTP pooling disabled via  -Dhttp.keepAlive=false
3. Builds are still frequently failing with "Connection Reset"
4. The errors happen right after running Core tests

Hypothesis:
1. Maven has its own connection pooling system as documented at https://issues.apache.org/jira/browse/WAGON-545
   So even when JDK pooling is disabled there is still a pool on a higher level.

2. Azure infra kills a pooled TCP connection while tests are running

3. When Core tests are finished Maven starts building the Benchmark module.
   The Benchmark module uses a different Maven Clean plugin version -> Maven
   wants to download this version by using a connection from its pool. When
   this connection happens to be killed by Azure then Maven fails to download
   the clean plugin -> Build Error

Assuming the hypothesis above is correct then decreasing TTL on connection
in the Maven pool should eliminate the errors. In fact, it's documented
at https://issues.apache.org/jira/browse/WAGON-545?focusedCommentId=16755035&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-16755035

If just decreasing TTL won't help then the next step is to disable
the Maven pool entirely.
@ideoma ideoma merged commit 3b8a934 into master Feb 22, 2023
@ideoma ideoma deleted the build/disable-wagon-pooling branch February 22, 2023 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants