Skip to content

Commit d1f5f2e

Browse files
committed
add timeout for artifact resolver via ivy settings
1 parent a8b86e7 commit d1f5f2e

File tree

1 file changed

+31
-7
lines changed

1 file changed

+31
-7
lines changed

coral-hive/src/main/resources/ivy.settings.xml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,65 @@
11
<!--
2-
32
Copyright 2020 LinkedIn Corporation. All rights reserved.
43
Licensed under the BSD-2 Clause license.
54
See LICENSE in the project root for license information.
6-
75
-->
86
<ivysettings>
7+
8+
<!-- Define timeouts for resolvers
9+
Reference: https://ant.apache.org/ivy/history/2.5.0-rc1/settings/timeout-constraint.html
10+
11+
The <timeout-constraint> element allows you to define named timeout constraints that can be referenced
12+
in other parts of the Ivy settings file, such as resolvers.
13+
14+
Attributes:
15+
- name: (Required) The name of the timeout constraint.
16+
- connectionTimeout: (Optional) Specifies the time, in milliseconds, to wait for a connection to be established.
17+
- A value greater than 0 is used literally as the timeout.
18+
- A value of 0 indicates no timeout (wait-forever).
19+
- A value less than 0 lets the users of this timeout constraint decide what semantics to use.
20+
- readTimeout: (Optional) Specifies the time, in milliseconds, to wait when reading content from a resource after a connection is established.
21+
- A value greater than 0 is used literally as the timeout.
22+
- A value of 0 indicates no timeout (wait-forever).
23+
- A value less than 0 lets the users of this timeout constraint decide what semantics to use.
24+
25+
For large files, this setting helps avoid premature timeouts during the download process. The `readTimeout` is
26+
applied between receiving data packets, not for the entire download process. If the server continuously sends data,
27+
this timeout won't be triggered.
28+
-->
29+
<timeout-constraint name="default-timeout" connect-timeout="10000" read-timeout="30000" />
30+
931
<property name="artifactory.base.url" value="http://artifactory.corp.linkedin.com:8081/artifactory"/>
1032
<property name="artifactory.failover.url" value="http://artifactory-failover.corp.linkedin.com:8081/artifactory"/>
33+
1134
<caches lockStrategy="artifact-lock" />
1235
<settings defaultResolver="downloadGrapes" />
36+
1337
<resolvers>
1438
<chain name="downloadGrapes" returnFirst="true">
15-
39+
1640
<dual name="artifactory-release-resolver">
17-
<url name="public" m2compatible="true">
41+
<url name="public" m2compatible="true" timeout-constraint="default-timeout">
1842
<ivy pattern="${artifactory.base.url}/release/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).ivy" />
1943
</url>
2044
<ibiblio name="public" m2compatible="true" root="${artifactory.base.url}/release" />
2145
</dual>
2246

2347
<dual name="artifactory-release-failover-resolver">
24-
<url name="public" m2compatible="true">
48+
<url name="public" m2compatible="true" timeout-constraint="default-timeout">
2549
<ivy pattern="${artifactory.failover.url}/release/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).ivy" />
2650
</url>
2751
<ibiblio name="public" m2compatible="true" root="${artifactory.failover.url}/release" />
2852
</dual>
2953

3054
<dual name="artifactory-snapshot-resolver">
31-
<url name="public" m2compatible="true">
55+
<url name="public" m2compatible="true" timeout-constraint="default-timeout">
3256
<ivy pattern="${artifactory.base.url}/snapshot/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).ivy" />
3357
</url>
3458
<ibiblio name="public" m2compatible="true" root="${artifactory.base.url}/snapshot" />
3559
</dual>
3660

3761
<dual name="artifactory-snapshot-failover-resolver">
38-
<url name="public" m2compatible="true">
62+
<url name="public" m2compatible="true" timeout-constraint="default-timeout">
3963
<ivy pattern="${artifactory.failover.url}/snapshot/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).ivy" />
4064
</url>
4165
<ibiblio name="public" m2compatible="true" root="${artifactory.failover.url}/snapshot" />

0 commit comments

Comments
 (0)