修复扫描现场死锁的bug,通过延迟删除方式销毁compile_group_relation。

This commit is contained in:
zhengchao
2019-06-13 19:53:08 +08:00
parent 0992c8a14b
commit 8e0d69eec1
2 changed files with 6 additions and 1 deletions

View File

@@ -1128,7 +1128,7 @@ void destroy_compile_group_relation(struct Maat_compile_group_relation * p, stru
assert(p_group==NULL); assert(p_group==NULL);
} }
HASH_delete_by_id(scanner->compile_hash, p->compile_id); HASH_delete_by_id(scanner->compile_hash, p->compile_id);
_destroy_compile_group_relation(p); garbage_bagging(GARBAGE_COMPILE_GOURP_RELATION, p, scanner->tomb_ref);
} }
scan_rule_t* create_rs_str_rule(unsigned int sub_type,enum MAAT_MATCH_METHOD match_method,int is_case_sensitive,const char* string,int len,int l_offset,int r_offset) scan_rule_t* create_rs_str_rule(unsigned int sub_type,enum MAAT_MATCH_METHOD match_method,int is_case_sensitive,const char* string,int len,int l_offset,int r_offset)
{ {
@@ -3469,6 +3469,9 @@ void garbage_bury(MESA_lqueue_head garbage_q,int timeout,void *logger)
case GARBAGE_COMPILE_RULE: case GARBAGE_COMPILE_RULE:
destroy_compile_rule(bag->compile_rule); destroy_compile_rule(bag->compile_rule);
break; break;
case GARBAGE_COMPILE_GOURP_RELATION:
_destroy_compile_group_relation(bag->compile_group_relation);
break;
case GARBAGE_GROUP_RULE: case GARBAGE_GROUP_RULE:
_destroy_group_rule(bag->group_rule); _destroy_group_rule(bag->group_rule);
break; break;

View File

@@ -192,6 +192,7 @@ enum maat_garbage_type
GARBAGE_SCANNER=0, GARBAGE_SCANNER=0,
GARBAGE_GROUP_RULE, GARBAGE_GROUP_RULE,
GARBAGE_COMPILE_RULE, GARBAGE_COMPILE_RULE,
GARBAGE_COMPILE_GOURP_RELATION,
GARBAGE_BOOL_MATCHER, GARBAGE_BOOL_MATCHER,
GARBAGE_MAP_STR2INT, GARBAGE_MAP_STR2INT,
GARBAGE_FOREIGN_FILE GARBAGE_FOREIGN_FILE
@@ -432,6 +433,7 @@ struct _maat_garbage_t
struct Maat_scanner_t* scanner; struct Maat_scanner_t* scanner;
struct Maat_group_inner* group_rule; struct Maat_group_inner* group_rule;
struct Maat_compile_rule* compile_rule; struct Maat_compile_rule* compile_rule;
struct Maat_compile_group_relation * compile_group_relation;
struct bool_matcher* bool_matcher; struct bool_matcher* bool_matcher;
void * raw; void * raw;
MESA_htable_handle str2int_map; MESA_htable_handle str2int_map;