From 1648366d5a12b0f9e5e43302898f231fc7d0ba83 Mon Sep 17 00:00:00 2001 From: wlx5575 Date: Sat, 18 Mar 2023 19:56:06 +0800 Subject: [PATCH] Optimize jetcd initialization invoke --- src/main/java/com/jd/jdbc/topo/etcd2topo/Etcd2TopoFactory.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/jd/jdbc/topo/etcd2topo/Etcd2TopoFactory.java b/src/main/java/com/jd/jdbc/topo/etcd2topo/Etcd2TopoFactory.java index 59ec28a..a7e5ec7 100644 --- a/src/main/java/com/jd/jdbc/topo/etcd2topo/Etcd2TopoFactory.java +++ b/src/main/java/com/jd/jdbc/topo/etcd2topo/Etcd2TopoFactory.java @@ -93,6 +93,8 @@ private Etcd2TopoServer newServerWithOpts(String serverAddr, String root, String .keepaliveTimeout(Duration.ofSeconds(10L)) .keepaliveTime(Duration.ofSeconds(10L)) .keepaliveWithoutCalls(true) + .connectTimeout(Duration.ofSeconds(5)) + .waitForReady(false) .executorService(TabletNettyExecutorService.getNettyExecutorService()).build(); Etcd2TopoServer etcd2TopoServer = new Etcd2TopoServer();