必须适配RuleScan 2016_10_21以上版本。
避免在销毁rulescan句柄后,在rulescan_endstream时的段错误。
This commit is contained in:
@@ -1297,9 +1297,14 @@ void Maat_stream_scan_string_end(stream_para_t* stream_para)
|
||||
if(sp->version==sp->feather->maat_version)
|
||||
{
|
||||
DEC_SCANNER_REF(scanner, sp->thread_num);
|
||||
}
|
||||
rulescan_endstream(sp->rs_stream_para);
|
||||
|
||||
rulescan_endstream(sp->rs_stream_para);
|
||||
}
|
||||
else
|
||||
{
|
||||
rulescan_endstream_simple(sp->rs_stream_para);
|
||||
sp->feather->zombie_rs_stream--;
|
||||
}
|
||||
|
||||
}
|
||||
if(sp->last_cache!=NULL)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "mesa_fuzzy.h"
|
||||
#include "great_index_engine.h"
|
||||
|
||||
int MAAT_FRAME_VERSION_1_8_20161008=1;
|
||||
int MAAT_FRAME_VERSION_1_8_20161021_zombie_stream=1;
|
||||
const char *maat_module="MAAT Frame";
|
||||
|
||||
const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin",
|
||||
@@ -2484,7 +2484,6 @@ void garbage_bury(MESA_lqueue_head garbage_q,void *logger)
|
||||
break;
|
||||
case GARBAGE_SCANNER:
|
||||
ref_cnt=aligment_int64_array_sum(bag->scanner->ref_cnt,bag->scanner->max_thread_num);
|
||||
|
||||
if(ref_cnt==0)
|
||||
{
|
||||
MESA_handle_runtime_log(logger,RLOG_LV_INFO,maat_module,
|
||||
@@ -2795,6 +2794,7 @@ void *thread_rule_monitor(void *arg)
|
||||
{
|
||||
assert(feather->scanner->version>old_scanner->version);
|
||||
assert(old_scanner->tomb_ref==feather->garbage_q);
|
||||
feather->zombie_rs_stream+=aligment_int64_array_sum(old_scanner->ref_cnt,old_scanner->max_thread_num);
|
||||
garbage_bagging(GARBAGE_SCANNER, old_scanner, feather->garbage_q);
|
||||
}
|
||||
feather->update_tmp_scanner=NULL;
|
||||
|
||||
@@ -365,6 +365,7 @@ struct _Maat_feather_t
|
||||
long long update_err_cnt;//sum of the same name variable in each table
|
||||
long long iconv_err_cnt;//sum of the same name variable in each table
|
||||
long long scan_err_cnt;
|
||||
long long zombie_rs_stream;
|
||||
};
|
||||
struct _maat_garbage_t
|
||||
{
|
||||
|
||||
@@ -13,7 +13,8 @@ enum MAAT_FS_STATUS{
|
||||
STATUS_TOTAL_SCAN_CNT,
|
||||
STATUS_UPDATE_ERR_CNT,
|
||||
STATUS_ICONV_ERR_CNT,
|
||||
STATUS_SCAN_ERR_CNT
|
||||
STATUS_SCAN_ERR_CNT,
|
||||
STATUS_ZOMBIE_RS_STREAM
|
||||
};
|
||||
|
||||
enum MAAT_FS_COLUMN
|
||||
@@ -52,6 +53,8 @@ void maat_stat_init(struct _Maat_feather_t* feather)
|
||||
feather->fs_status_id[STATUS_UPDATE_ERR_CNT]=FS_register(feather->stat_handle, FS_STYLE_STATUS, FS_CALC_CURRENT,"update_error");
|
||||
feather->fs_status_id[STATUS_ICONV_ERR_CNT]=FS_register(feather->stat_handle, FS_STYLE_STATUS, FS_CALC_CURRENT,"iconv_error");
|
||||
feather->fs_status_id[STATUS_SCAN_ERR_CNT]=FS_register(feather->stat_handle, FS_STYLE_STATUS, FS_CALC_CURRENT,"scan_error");
|
||||
feather->fs_status_id[STATUS_ZOMBIE_RS_STREAM]=FS_register(feather->stat_handle, FS_STYLE_STATUS, FS_CALC_CURRENT,"zombie_stream");
|
||||
|
||||
|
||||
feather->fs_column_id[COLUMN_TABLE_RULE_NUM]=FS_register(feather->stat_handle, FS_STYLE_COLUMN, FS_CALC_CURRENT,"rule");
|
||||
feather->fs_column_id[COLUMN_TABLE_REGEX_NUM]=FS_register(feather->stat_handle, FS_STYLE_COLUMN, FS_CALC_CURRENT,"regex");
|
||||
@@ -277,6 +280,7 @@ void maat_stat_output(struct _Maat_feather_t* feather)
|
||||
FS_operate(feather->stat_handle, feather->fs_status_id[STATUS_UPDATE_ERR_CNT], 0,FS_OP_SET,feather->update_err_cnt);
|
||||
FS_operate(feather->stat_handle, feather->fs_status_id[STATUS_ICONV_ERR_CNT], 0,FS_OP_SET,feather->iconv_err_cnt);
|
||||
FS_operate(feather->stat_handle, feather->fs_status_id[STATUS_SCAN_ERR_CNT], 0,FS_OP_SET,feather->scan_err_cnt);
|
||||
FS_operate(feather->stat_handle, feather->fs_status_id[STATUS_ZOMBIE_RS_STREAM], 0,FS_OP_SET,feather->zombie_rs_stream);
|
||||
|
||||
FS_passive_output(feather->stat_handle);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user