Skip to content

Commit a32dada

Browse files
authored
Merge branch 'master' into imds-token-other-calls
2 parents 24c652f + 4fc588c commit a32dada

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"category": "AWS SDK for Java v2",
3+
"type": "bugfix",
4+
"description": "Reduce ReadTimeout and ConnectTimeout for accessing EC2 metadata instance service"
5+
}

core/regions/src/main/java/software/amazon/awssdk/regions/internal/util/ConnectionUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public HttpURLConnection connectToEndpoint(URI endpoint, Map<String, String> hea
3636

3737
public HttpURLConnection connectToEndpoint(URI endpoint, Map<String, String> headers, String method) throws IOException {
3838
HttpURLConnection connection = (HttpURLConnection) endpoint.toURL().openConnection(Proxy.NO_PROXY);
39-
connection.setConnectTimeout(1000 * 2);
40-
connection.setReadTimeout(1000 * 5);
39+
connection.setConnectTimeout(1000);
40+
connection.setReadTimeout(1000);
4141
connection.setRequestMethod(method);
4242
connection.setDoOutput(true);
4343
headers.forEach(connection::addRequestProperty);

0 commit comments

Comments
 (0)