We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 83666de + 8b4eaad commit 667a598Copy full SHA for 667a598
newrelic-agent/src/main/java/com/newrelic/agent/utilization/AwsFargateMetadataFetcher.java
@@ -10,6 +10,7 @@
10
import java.io.InputStream;
11
import java.net.MalformedURLException;
12
import java.net.URL;
13
+import java.net.URLConnection;
14
15
/**
16
* Thin wrapper class over the JRE URL class to assist in testing
@@ -22,6 +23,10 @@ public AwsFargateMetadataFetcher(String metadataUrl) throws MalformedURLExceptio
22
23
}
24
25
public InputStream openStream() throws IOException {
- return (url == null ? null : url.openStream());
26
+ URLConnection connection = url.openConnection();
27
+ connection.setConnectTimeout(5000);
28
+ connection.setReadTimeout(5000);
29
+
30
+ return connection.getInputStream();
31
32
0 commit comments