From d4cdee2dc279c9701aedd670fd9f4e74568ff497 Mon Sep 17 00:00:00 2001 From: Micheal X Date: Sun, 29 Oct 2023 19:02:37 +1300 Subject: [PATCH] 5.8.6 fix seley ip_manager bug. --- code/default/lib/noarch/front_base/http1.py | 4 ++-- code/default/lib/noarch/front_base/http_common.py | 2 +- code/default/version.txt | 2 +- code/default/x_tunnel/local/seley_front/ip_manager.py | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/code/default/lib/noarch/front_base/http1.py b/code/default/lib/noarch/front_base/http1.py index af1dc5f122..b8e7f529b3 100644 --- a/code/default/lib/noarch/front_base/http1.py +++ b/code/default/lib/noarch/front_base/http1.py @@ -162,7 +162,7 @@ def request_task(self, task): task.set_state("h1_req_sended") except Exception as e: - self.logger.exception("%s h1_request send:%r inactive_time:%d task.timeout:%d", + self.logger.warn("%s h1_request send:%r inactive_time:%d task.timeout:%d", self.ip_str, e, time.time() - self.last_recv_time, task.timeout) self.logger.warn('%s trace:%s', self.ip_str, self.get_trace()) @@ -176,7 +176,7 @@ def request_task(self, task): response.begin(timeout=timeout) task.set_state("response_begin") except Exception as e: - self.logger.exception("%s h1_request recv:%r inactive_time:%d task.timeout:%d", + self.logger.warn("%s h1_request recv:%r inactive_time:%d task.timeout:%d", self.ip_str, e, time.time() - self.last_recv_time, task.timeout) self.logger.warn('%s trace:%s', self.ip_str, self.get_trace()) diff --git a/code/default/lib/noarch/front_base/http_common.py b/code/default/lib/noarch/front_base/http_common.py index 1eb8bcb5e3..5ebd465365 100644 --- a/code/default/lib/noarch/front_base/http_common.py +++ b/code/default/lib/noarch/front_base/http_common.py @@ -199,7 +199,7 @@ def __init__(self, logger, ip_manager, config, ssl_sock, close_cb, retry_task_cb self.ssl_sock = ssl_sock self.handshake = ssl_sock.handshake_time * 0.001 self.rtt = ssl_sock.handshake_time * 0.001 - self.streams = [] + self.streams = {} self.ip_str = ssl_sock.ip_str self.close_cb = close_cb self.retry_task_cb = retry_task_cb diff --git a/code/default/version.txt b/code/default/version.txt index a94a88fbb8..fb54fe3dc1 100644 --- a/code/default/version.txt +++ b/code/default/version.txt @@ -1 +1 @@ -5.8.5 \ No newline at end of file +5.8.6 \ No newline at end of file diff --git a/code/default/x_tunnel/local/seley_front/ip_manager.py b/code/default/x_tunnel/local/seley_front/ip_manager.py index 0e5b92b560..dda2f8bcd1 100644 --- a/code/default/x_tunnel/local/seley_front/ip_manager.py +++ b/code/default/x_tunnel/local/seley_front/ip_manager.py @@ -25,10 +25,11 @@ def __str__(self): return o def set_hosts(self, hosts): - self.hosts = hosts try: with open(self.config_fn, "w") as fd: - json.dump(self.hosts, fd, indent=2) + json.dump(hosts, fd, indent=2) + + self.load() except Exception as e: xlog.error("save hosts %s e:%r", self.config_fn, e)