Skip to content

Commit 72efe58

Browse files
Techassisbernauer
andauthored
chore(java-devel): Tweak Maven transport settings (#1586)
Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.tech>
1 parent 10f74b0 commit 72efe58

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

java-devel/stackable/settings.xml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040

4141
<properties>
4242
<!--
43+
Resolver specific configuration keys can be found here: https://maven.apache.org/resolver/configuration.html
44+
4345
This is to work around an issue where Maven builds in Github Actions would randomly fail.
4446
There is some evidence that points at Azure networking as the root cause where it closes idle connections (silently) after 4 minutes.
4547
Maven would then sometimes reuse an "old" connection from its connection pool and would encounter issues due to these connection closures.
@@ -51,10 +53,35 @@
5153
-->
5254

5355
<!-- Old name: maven-resolver 1.x, Maven 3.x -->
54-
<aether.connector.http.connectionMaxTtl>30</aether.connector.http.connectionMaxTtl>
56+
<aether.connector.http.connectionMaxTtl>25</aether.connector.http.connectionMaxTtl>
5557

5658
<!-- New name: maven-resolver 2.x, as of Maven 4.x -->
57-
<aether.transport.http.connectionMaxTtl>30</aether.transport.http.connectionMaxTtl>
59+
<aether.transport.http.connectionMaxTtl>25</aether.transport.http.connectionMaxTtl>
60+
61+
<!--
62+
By default, requests are retried 3 times. We increase the count slightly to hopefully get less failing
63+
builds in CI.
64+
-->
65+
<aether.transport.http.retryHandler.count>5</aether.transport.http.retryHandler.count>
66+
67+
<!--
68+
By default, retries wait for 5000 milliseconds (5 seconds). We increase this to 10000 milliseconds
69+
(10 seconds) to spam the Nexus instance a little less.
70+
-->
71+
<aether.transport.http.retryHandler.interval>10000</aether.transport.http.retryHandler.interval>
72+
73+
<!--
74+
Servers can respond with `Retry-After` headers. By default, the value is capped at 300000 milliseconds (300
75+
seconds). We reduce this to 60000 (60 seconds) to avoid super long retry intervals.
76+
-->
77+
<aether.transport.http.retryHandler.intervalMax>60000</aether.transport.http.retryHandler.intervalMax>
78+
79+
<!--
80+
This is an option we can experiment with in the future. Settings this to false will result in no connection
81+
pooling, which should help to avoid stale/long-lasting connections which can become inactive and be killed by
82+
the Azure networking.
83+
-->
84+
<!-- <aether.transport.http.reuseConnections>false</aether.transport.http.reuseConnections> -->
5885
</properties>
5986
</profile>
6087
</profiles>

0 commit comments

Comments
 (0)