File tree Expand file tree Collapse file tree
branches/autosynth-bigtable/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ refs/heads/autosynth-asset: cd8251de8c40e239ad24dcf9ed93ea2708a3eed5
126126refs/heads/autosynth-automl: cced2f56bbef0499609073edbca6253e1df5e535
127127refs/heads/autosynth-bigquerydatatransfer: a6667617707608b1dbfb02d59c22b5152f208da7
128128refs/heads/autosynth-bigquerystorage: 14ab055598b943ae3f33f484e9fb1653355d08e7
129- refs/heads/autosynth-bigtable: d6b2c21e731a4307128d79d65daa64893e421a5a
129+ refs/heads/autosynth-bigtable: 44db7693731df97d301be39001377ed9460b938c
130130refs/heads/autosynth-bigtable-admin: 6379a2bc712f2736c83de0e009b4d26da4fa82ca
131131refs/heads/autosynth-containeranalysis: 781fdb430a60f9a6491f116e31e4e10118157bdb
132132refs/heads/autosynth-datastore: af1fb76aa3eee02fe6f31f8fa1c72a4f048d149b
Original file line number Diff line number Diff line change 3434public class MetadataConfig {
3535
3636 private static final String METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/" ;
37+ private static final int TIMEOUT_MS = 5000 ;
3738
3839 private MetadataConfig () {}
3940
@@ -69,6 +70,8 @@ public static String getAttribute(String attributeName) {
6970 try {
7071 URL url = new URL (METADATA_URL + attributeName );
7172 HttpURLConnection connection = (HttpURLConnection ) url .openConnection ();
73+ connection .setConnectTimeout (TIMEOUT_MS );
74+ connection .setReadTimeout (TIMEOUT_MS );
7275 connection .setRequestProperty ("Metadata-Flavor" , "Google" );
7376 InputStream input = connection .getInputStream ();
7477 if (connection .getResponseCode () == 200 ) {
You can’t perform that action at this time.
0 commit comments