Skip to content

Commit 66834f7

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

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

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

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,30 @@
66
77
-->
88
<ivysettings>
9+
10+
<!-- Define timeouts for resolvers
11+
Reference: https://ant.apache.org/ivy/history/2.5.0-rc1/settings/timeout-constraint.html
12+
13+
The <timeout-constraint> element allows you to define named timeout constraints that can be referenced
14+
in other parts of the Ivy settings file, such as resolvers.
15+
16+
Attributes:
17+
- name: (Required) The name of the timeout constraint.
18+
- connectionTimeout: (Optional) Specifies the time, in milliseconds, to wait for a connection to be established.
19+
- A value greater than 0 is used literally as the timeout.
20+
- A value of 0 indicates no timeout (wait-forever).
21+
- A value less than 0 lets the users of this timeout constraint decide what semantics to use.
22+
- readTimeout: (Optional) Specifies the time, in milliseconds, to wait when reading content from a resource after a connection is established.
23+
- A value greater than 0 is used literally as the timeout.
24+
- A value of 0 indicates no timeout (wait-forever).
25+
- A value less than 0 lets the users of this timeout constraint decide what semantics to use.
26+
27+
For large files, this setting helps avoid premature timeouts during the download process. The `readTimeout` is
28+
applied between receiving data packets, not for the entire download process. If the server continuously sends data,
29+
this timeout won't be triggered.
30+
-->
31+
<timeout-constraint name="default-timeout" connect-timeout="10000" read-timeout="30000" />
32+
933
<property name="artifactory.base.url" value="http://artifactory.corp.linkedin.com:8081/artifactory"/>
1034
<property name="artifactory.failover.url" value="http://artifactory-failover.corp.linkedin.com:8081/artifactory"/>
1135
<caches lockStrategy="artifact-lock" />
@@ -14,28 +38,28 @@
1438
<chain name="downloadGrapes" returnFirst="true">
1539

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)