From 99e09fe348e081fb918ef166b4469ffcc1471698 Mon Sep 17 00:00:00 2001 From: Micheal X Date: Mon, 10 Jul 2023 13:47:01 +1200 Subject: [PATCH] reset on exceed max connection. --- code/default/version.txt | 2 +- code/default/x_tunnel/local/base_container.py | 2 ++ code/default/x_tunnel/local/proxy_session.py | 6 ++---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/default/version.txt b/code/default/version.txt index e230c8396d..7d3cdbf0dd 100644 --- a/code/default/version.txt +++ b/code/default/version.txt @@ -1 +1 @@ -5.3.0 \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/code/default/x_tunnel/local/base_container.py b/code/default/x_tunnel/local/base_container.py index 053b23c326..9cb53c743f 100644 --- a/code/default/x_tunnel/local/base_container.py +++ b/code/default/x_tunnel/local/base_container.py @@ -531,6 +531,8 @@ def cmd_processor(self): self.xlog.debug("Conn session:%s conn:%d Peer Close:%s", self.session.session_id, self.conn_id, dat) if self.is_client: self.transfer_peer_close("finish") + if b"exceed the max connection" in dat: + self.session.reset() self.stop("peer close") elif cmd_id == 0: # Create connect diff --git a/code/default/x_tunnel/local/proxy_session.py b/code/default/x_tunnel/local/proxy_session.py index 7692712bdd..399d3dc233 100644 --- a/code/default/x_tunnel/local/proxy_session.py +++ b/code/default/x_tunnel/local/proxy_session.py @@ -709,10 +709,8 @@ def normal_round_trip_worker(self, work_id): # session not exist if self.session_id == request_session_id: xlog.warn("server session_id:%s not exist, reset session.", request_session_id) - self.reset() - return - else: - return + self.reset() + return else: xlog.error("unknown error code:%d, message:%s", error_code, message) time.sleep(sleep_time)