和redis通信发生错误后,立即关闭链接,待下次遍历重连。

This commit is contained in:
zhengchao
2022-07-13 14:59:28 +08:00
parent d482a8d226
commit 47a71011db
2 changed files with 8 additions and 4 deletions

View File

@@ -1761,7 +1761,9 @@ void redis_monitor_traverse(long long version, struct source_redis_ctx* m
rule_num=get_rm_key_list(mr_ctx->read_ctx, version, feather->load_version_from, &new_version, feather->table_mgr, &rule_list, &update_type, logger, feather->cumulative_update_off);
if(rule_num<0)//redis communication error
{
{
redisFree(mr_ctx->read_ctx);
mr_ctx->read_ctx=NULL;
return;
}
feather->load_version_from=0;//only valid for one time.
@@ -1772,9 +1774,11 @@ void redis_monitor_traverse(long long version, struct source_redis_ctx* m
if(rule_num>0)
{
ret=get_maat_redis_value(mr_ctx->read_ctx, rule_list, rule_num, logger, 0);
if(ret<0)
if(ret<0)//redis communication error
{
MESA_handle_runtime_log(logger, RLOG_LV_INFO,maat_redis_monitor, "Get Redis value failed, abandon update.");
redisFree(mr_ctx->read_ctx);
mr_ctx->read_ctx=NULL;
MESA_handle_runtime_log(logger, RLOG_LV_INFO, maat_redis_monitor, "Get Redis value failed, abandon update and close connection.");
goto clean_up;
}
for(i=0;i<rule_num;i++)

View File

@@ -57,7 +57,7 @@ extern "C"
}
#endif
int MAAT_FRAME_VERSION_3_6_10_20220630=1;
int MAAT_FRAME_VERSION_3_6_11_20220713=1;
int is_valid_table_name(const char* str)
{