diff --git a/fe/fe-core/src/main/java/com/starrocks/common/Config.java b/fe/fe-core/src/main/java/com/starrocks/common/Config.java index 5de89266dde1b..0bd273d6cfd14 100644 --- a/fe/fe-core/src/main/java/com/starrocks/common/Config.java +++ b/fe/fe-core/src/main/java/com/starrocks/common/Config.java @@ -2634,6 +2634,15 @@ public class Config extends ConfigBase { @ConfField(mutable = true) public static int starmgr_grpc_timeout_seconds = 5; + @ConfField(mutable = true) + public static int star_client_read_timeout_seconds = 15; + + @ConfField(mutable = true) + public static int star_client_list_timeout_seconds = 30; + + @ConfField(mutable = true) + public static int star_client_write_timeout_seconds = 30; + // *********************************************************** // * END: of Cloud native meta server related configurations // *********************************************************** diff --git a/fe/fe-core/src/main/java/com/starrocks/lake/StarOSAgent.java b/fe/fe-core/src/main/java/com/starrocks/lake/StarOSAgent.java index dc574825db9a7..37c8170c12470 100644 --- a/fe/fe-core/src/main/java/com/starrocks/lake/StarOSAgent.java +++ b/fe/fe-core/src/main/java/com/starrocks/lake/StarOSAgent.java @@ -97,6 +97,17 @@ public StarOSAgent() { public boolean init(StarManagerServer server) { client = new StarClient(server); client.connectServer(String.format("127.0.0.1:%d", Config.cloud_native_meta_port)); + GlobalStateMgr.getCurrentState().getConfigRefreshDaemon().registerListener(() -> { + client.setClientReadTimeoutSec(Config.star_client_read_timeout_seconds); + client.setClientListTimeoutSec(Config.star_client_list_timeout_seconds); + client.setClientWriteTimeoutSec(Config.star_client_write_timeout_seconds); + }); + return true; + } + + public boolean initForTest() { + client = new StarClient(null); + client.connectServer(String.format("127.0.0.1:%d", Config.cloud_native_meta_port)); return true; } diff --git a/fe/fe-core/src/test/java/com/starrocks/lake/StarOSAgentTest.java b/fe/fe-core/src/test/java/com/starrocks/lake/StarOSAgentTest.java index e65f5526d75e8..b3526d0ba0e0c 100644 --- a/fe/fe-core/src/test/java/com/starrocks/lake/StarOSAgentTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/lake/StarOSAgentTest.java @@ -76,7 +76,7 @@ public class StarOSAgentTest { @Before public void setUp() throws Exception { starosAgent = new StarOSAgent(); - starosAgent.init(null); + starosAgent.initForTest(); Config.cloud_native_storage_type = "S3"; }