-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 优化健康检查逻辑 feat: 控制台样式优化 fix : 修复限流block不生效 fix : 补充文档 feat: 事务日程调整
- Loading branch information
Showing
14 changed files
with
460 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
|
||
## 事务更新日程 | ||
|
||
2022-12-21 | ||
|
||
1. 支持滑动窗口算法 | ||
|
||
2. 优化健康检查逻辑 | ||
|
||
3. 修复限流block不生效 | ||
|
||
4. 补充文档 | ||
|
||
5. 事务日程调整 | ||
|
||
|
||
2022-09-15 | ||
|
||
1. 支持登录插件配置实时修改 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,18 +4,16 @@ | |
-- @author iamtsm | ||
-- @email [email protected] | ||
|
||
local cjson = require("cjson.safe") | ||
local tlog = require("utils.tl_ops_utils_log"):new("tl_ops_health") | ||
local tl_ops_utils_func = require("utils.tl_ops_utils_func") | ||
local tl_ops_constant_health = require("constant.tl_ops_constant_health") | ||
local tl_ops_status = require("constant.tl_ops_constant_comm").tl_ops_status; | ||
local tl_ops_health_check_dynamic_conf = require("health.tl_ops_health_check_dynamic_conf") | ||
local tl_ops_health_check_version = require("health.tl_ops_health_check_version") | ||
local nx_socket = ngx.socket.tcp | ||
local shared = ngx.shared.tlopsbalance | ||
local find = ngx.re.find | ||
|
||
|
||
local cjson = require("cjson.safe") | ||
local tlog = require("utils.tl_ops_utils_log"):new("tl_ops_health") | ||
local tl_ops_utils_func = require("utils.tl_ops_utils_func") | ||
local tl_ops_constant_health = require("constant.tl_ops_constant_health") | ||
local tl_ops_status = require("constant.tl_ops_constant_comm").tl_ops_status; | ||
local tl_ops_health_check_dynamic_conf = require("health.tl_ops_health_check_dynamic_conf") | ||
local tl_ops_health_check_version = require("health.tl_ops_health_check_version") | ||
local nx_socket = ngx.socket.tcp | ||
local shared = ngx.shared.tlopsbalance | ||
local find = ngx.re.find | ||
|
||
local _M = { | ||
_VERSION = '0.02' | ||
|
@@ -238,26 +236,29 @@ tl_ops_health_check_nodes = function (conf) | |
local bytes, _ = sock:send(check_content .. "\r\n\r\n\r\n") | ||
if not bytes then | ||
tlog:err("tl_ops_health_check_nodes failed to send socket: ", _) | ||
socket:close() | ||
tl_ops_health_check_node_failed(conf, node_id, node) | ||
break | ||
end | ||
|
||
tlog:dbg("tl_ops_health_check_nodes send socket ok : byte=", bytes) | ||
|
||
-- socket反馈 | ||
local receive_line, _ = sock:receive() | ||
if not receive_line then | ||
local receive_10k, _ = sock:receiveany(10240) | ||
if not receive_10k then | ||
if _ == "check_timeout" then | ||
tlog:err("tl_ops_health_check_nodes socket check_timeout: ", _) | ||
sock:close() | ||
end | ||
|
||
tlog:err("tl_ops_health_check_nodes socket receive failed: ", receive_10k) | ||
sock:close() | ||
tl_ops_health_check_node_failed(conf, node_id, node) | ||
break | ||
end | ||
|
||
tlog:dbg("tl_ops_health_check_nodes receive socket ok : ", receive_line) | ||
tlog:dbg("tl_ops_health_check_nodes receive socket ok : ", receive_10k) | ||
|
||
local from, to, _ = find(receive_line, [[^HTTP/\d+\.\d+\s+(\d+)]], "joi", nil, 1) | ||
local from, to, _ = find(receive_10k, [[^HTTP/\d+\.\d+\s+(\d+)]], "joi", nil, 1) | ||
if not from then | ||
tlog:err("tl_ops_health_check_nodes ngx.re.find receive err: ", from, to, _) | ||
sock:close() | ||
|
@@ -266,7 +267,7 @@ tl_ops_health_check_nodes = function (conf) | |
end | ||
|
||
-- 心跳状态 | ||
local status = tonumber(string.sub(receive_line, from, to)) | ||
local status = tonumber(string.sub(receive_10k, from, to)) | ||
|
||
tlog:dbg("tl_ops_health_check_nodes get status ok ,name=" ,name, ", status=" , status) | ||
local statusPass = false; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,13 @@ | |
-- @email [email protected] | ||
|
||
|
||
local cjson = require("cjson.safe"); | ||
local tlog = require("utils.tl_ops_utils_log"):new("tl_ops_health_check_dynamic_conf"); | ||
local tl_ops_utils_func = require("utils.tl_ops_utils_func"); | ||
local tl_ops_constant_health = require("constant.tl_ops_constant_health") | ||
local cache_health = require("cache.tl_ops_cache_core"):new("tl-ops-health"); | ||
local tl_ops_constant_service = require("constant.tl_ops_constant_service"); | ||
local shared = ngx.shared.tlopsbalance | ||
local cjson = require("cjson.safe"); | ||
local tlog = require("utils.tl_ops_utils_log"):new("tl_ops_health_check_dynamic_conf"); | ||
local tl_ops_utils_func = require("utils.tl_ops_utils_func"); | ||
local tl_ops_constant_health = require("constant.tl_ops_constant_health") | ||
local cache_health = require("cache.tl_ops_cache_core"):new("tl-ops-health"); | ||
local tl_ops_constant_service = require("constant.tl_ops_constant_service"); | ||
local shared = ngx.shared.tlopsbalance | ||
|
||
-- 需要提前定义,定时器访问不了 | ||
local tl_ops_health_check_dynamic_conf_add_timer_check; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,17 +4,17 @@ | |
-- @author iamtsm | ||
-- @email [email protected] | ||
|
||
local tl_ops_utils_func = require("utils.tl_ops_utils_func"); | ||
local tl_ops_utils_func = require("utils.tl_ops_utils_func"); | ||
local tl_ops_limit_fuse_check_dynamic_conf = require("limit.fuse.tl_ops_limit_fuse_check_dynamic_conf") | ||
local tl_ops_limit_fuse_check_version = require("limit.fuse.tl_ops_limit_fuse_check_version") | ||
local tl_ops_limit_token_bucket = require("limit.fuse.tl_ops_limit_fuse_token_bucket"); | ||
local tl_ops_limit_leak_bucket = require("limit.fuse.tl_ops_limit_fuse_leak_bucket"); | ||
local tl_ops_constant_limit = require("constant.tl_ops_constant_limit") | ||
local tl_ops_constant_health = require("constant.tl_ops_constant_health") | ||
local tl_ops_constant_service = require("constant.tl_ops_constant_service") | ||
local shared = ngx.shared.tlopsbalance | ||
local cjson = require("cjson.safe"); | ||
local tlog = require("utils.tl_ops_utils_log"):new("tl_ops_limit_fuse"); | ||
local tl_ops_limit_fuse_check_version = require("limit.fuse.tl_ops_limit_fuse_check_version") | ||
local tl_ops_limit_token_bucket = require("limit.fuse.tl_ops_limit_fuse_token_bucket"); | ||
local tl_ops_limit_leak_bucket = require("limit.fuse.tl_ops_limit_fuse_leak_bucket"); | ||
local tl_ops_constant_limit = require("constant.tl_ops_constant_limit") | ||
local tl_ops_constant_health = require("constant.tl_ops_constant_health") | ||
local tl_ops_constant_service = require("constant.tl_ops_constant_service") | ||
local shared = ngx.shared.tlopsbalance | ||
local cjson = require("cjson.safe"); | ||
local tlog = require("utils.tl_ops_utils_log"):new("tl_ops_limit_fuse"); | ||
|
||
|
||
local _STATE = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,13 @@ | |
-- @author iamtsm | ||
-- @email [email protected] | ||
|
||
local cjson = require("cjson.safe"); | ||
local tlog = require("utils.tl_ops_utils_log"):new("tl_ops_limit_fuse_check_dynamic_conf"); | ||
local tl_ops_utils_func = require("utils.tl_ops_utils_func"); | ||
local tl_ops_constant_limit = require("constant.tl_ops_constant_limit") | ||
local cache_limit = require("cache.tl_ops_cache_core"):new("tl-ops-limit"); | ||
local cjson = require("cjson.safe"); | ||
local tlog = require("utils.tl_ops_utils_log"):new("tl_ops_limit_fuse_check_dynamic_conf"); | ||
local tl_ops_utils_func = require("utils.tl_ops_utils_func"); | ||
local tl_ops_constant_limit = require("constant.tl_ops_constant_limit") | ||
local cache_limit = require("cache.tl_ops_cache_core"):new("tl-ops-limit"); | ||
local tl_ops_constant_service = require("constant.tl_ops_constant_service") | ||
local shared = ngx.shared.tlopsbalance | ||
local shared = ngx.shared.tlopsbalance | ||
|
||
local tl_ops_limit_fuse_check_dynamic_conf_add_timer_check; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.