Skip to content

Commit

Permalink
Fix a pre-connect timeout issue (#1106)
Browse files Browse the repository at this point in the history
Signed-off-by: yhmo <[email protected]>
  • Loading branch information
yhmo authored Oct 14, 2024
1 parent 053e27f commit 63b27f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/io/milvus/v2/client/MilvusClientV2.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private void connect(ConnectConfig connectConfig, MilvusServiceGrpc.MilvusServic
.setLocalTime(clientUtils.getLocalTimeStr())
.build();
ConnectRequest req = ConnectRequest.newBuilder().setClientInfo(info).build();
ConnectResponse resp = blockingStub.withDeadlineAfter(1, TimeUnit.SECONDS)
ConnectResponse resp = blockingStub.withDeadlineAfter(connectConfig.getConnectTimeoutMs(), TimeUnit.MILLISECONDS)
.connect(req);
if (resp.getStatus().getCode() != 0 || !resp.getStatus().getErrorCode().equals(io.milvus.grpc.ErrorCode.Success)) {
throw new RuntimeException("Failed to initialize connection. Error: " + resp.getStatus().getReason());
Expand Down

0 comments on commit 63b27f2

Please sign in to comment.