Skip to content

Commit e53c3f1

Browse files
dmichel1ajaaym
authored andcommitted
---
yaml --- r: 19195 b: refs/heads/autosynth-bigquerystorage c: 44db769 h: refs/heads/master i: 19193: 246550d 19191: 95c8ea8
1 parent 6fcfd09 commit e53c3f1

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

  • branches/autosynth-bigquerystorage/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ refs/tags/v0.69.0: 78f67a29e8b9c46ba01de566a2eae0fd1c03edea
124124
refs/heads/autosynth-asset: cd8251de8c40e239ad24dcf9ed93ea2708a3eed5
125125
refs/heads/autosynth-automl: 2a8b018cf05811fd472e5d1053e67a12ceec0b64
126126
refs/heads/autosynth-bigquerydatatransfer: 564833a85642d4194adc025f021e10e723154246
127-
refs/heads/autosynth-bigquerystorage: d6b2c21e731a4307128d79d65daa64893e421a5a
127+
refs/heads/autosynth-bigquerystorage: 44db7693731df97d301be39001377ed9460b938c
128128
refs/heads/autosynth-bigtable: 2fbcb15847e0e89e79d6dc07420e28d7dfcea894
129129
refs/heads/autosynth-bigtable-admin: 6379a2bc712f2736c83de0e009b4d26da4fa82ca
130130
refs/heads/autosynth-containeranalysis: 039ca5b8db725c76c16a965ff26b2774322b8ef8

branches/autosynth-bigquerystorage/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/MetadataConfig.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
public 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) {

0 commit comments

Comments
 (0)