Skip to content

Commit ea7eec0

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

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

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

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,62 @@
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"/>
35+
1136
<caches lockStrategy="artifact-lock" />
1237
<settings defaultResolver="downloadGrapes" />
38+
1339
<resolvers>
1440
<chain name="downloadGrapes" returnFirst="true">
1541

1642
<dual name="artifactory-release-resolver">
17-
<url name="public" m2compatible="true">
43+
<url name="public" m2compatible="true" timeout-constraint="default-timeout">
1844
<ivy pattern="${artifactory.base.url}/release/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).ivy" />
1945
</url>
2046
<ibiblio name="public" m2compatible="true" root="${artifactory.base.url}/release" />
2147
</dual>
2248

2349
<dual name="artifactory-release-failover-resolver">
24-
<url name="public" m2compatible="true">
50+
<url name="public" m2compatible="true" timeout-constraint="default-timeout">
2551
<ivy pattern="${artifactory.failover.url}/release/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).ivy" />
2652
</url>
2753
<ibiblio name="public" m2compatible="true" root="${artifactory.failover.url}/release" />
2854
</dual>
2955

3056
<dual name="artifactory-snapshot-resolver">
31-
<url name="public" m2compatible="true">
57+
<url name="public" m2compatible="true" timeout-constraint="default-timeout">
3258
<ivy pattern="${artifactory.base.url}/snapshot/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).ivy" />
3359
</url>
3460
<ibiblio name="public" m2compatible="true" root="${artifactory.base.url}/snapshot" />
3561
</dual>
3662

3763
<dual name="artifactory-snapshot-failover-resolver">
38-
<url name="public" m2compatible="true">
64+
<url name="public" m2compatible="true" timeout-constraint="default-timeout">
3965
<ivy pattern="${artifactory.failover.url}/snapshot/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).ivy" />
4066
</url>
4167
<ibiblio name="public" m2compatible="true" root="${artifactory.failover.url}/snapshot" />

0 commit comments

Comments
 (0)