diff --git a/cluster/storage/src/main/java/com/linkedin/openhouse/cluster/storage/hdfs/HdfsStorageClient.java b/cluster/storage/src/main/java/com/linkedin/openhouse/cluster/storage/hdfs/HdfsStorageClient.java index 13d139c85..d7870b4d0 100644 --- a/cluster/storage/src/main/java/com/linkedin/openhouse/cluster/storage/hdfs/HdfsStorageClient.java +++ b/cluster/storage/src/main/java/com/linkedin/openhouse/cluster/storage/hdfs/HdfsStorageClient.java @@ -39,6 +39,16 @@ public synchronized void init() throws IOException { storageProperties.getTypes().get(HDFS_TYPE.getValue()); org.apache.hadoop.conf.Configuration configuration = new org.apache.hadoop.conf.Configuration(); configuration.set("fs.defaultFS", hdfsStorageProperties.getEndpoint()); + + // Connection timeout configuration - fail fast on unreachable nodes + configuration.set("ipc.client.connect.timeout", "10000"); // default: 20000ms, override to 10s + configuration.set( + "ipc.client.connect.max.retries", "3"); // default: 10, override to 3 per address + + // Socket timeout configuration - fail fast per datanode attempt + configuration.set( + "dfs.client.socket-timeout", "30000"); // default: 60000ms, override to 30s per node + fs = FileSystem.get(configuration); }