You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by al...@apache.org on 2025/01/15 03:44:28 UTC

(inlong) branch master updated: [INLONG-11660][SDK] Close exist conns if initConns() failed in Golang SDK (#11664)

This is an automated email from the ASF dual-hosted git repository.

aloyszhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 305f359636 [INLONG-11660][SDK] Close exist conns if initConns() failed in Golang SDK (#11664)
305f359636 is described below

commit 305f359636f367ffd83275d7d2b1fbf680292bcd
Author: gunli <24...@qq.com>
AuthorDate: Wed Jan 15 11:44:23 2025 +0800

    [INLONG-11660][SDK] Close exist conns if initConns() failed in Golang SDK (#11664)
---
 .../dataproxy-sdk-twins/dataproxy-sdk-golang/connpool/connpool.go      | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-golang/connpool/connpool.go b/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-golang/connpool/connpool.go
index 1054041cb4..636f9049e5 100755
--- a/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-golang/connpool/connpool.go
+++ b/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-golang/connpool/connpool.go
@@ -275,6 +275,9 @@ func (p *connPool) initConns(count int) error {
 
 	for err := range errs {
 		if err != nil {
+			for conn := range conns {
+				_ = conn.Close()
+			}
 			return err
 		}
 	}