diff options
| author | zhengchao <[email protected]> | 2017-08-03 18:37:33 +0800 |
|---|---|---|
| committer | zhengchao <[email protected]> | 2017-08-03 18:37:33 +0800 |
| commit | d9af8ba6ff64a074f89aeab5a7dd679f90e715f3 (patch) | |
| tree | 2d3452a32731f00a10ab05238fbeee984bc85b85 | |
| parent | ac0dae3b03675213495a7b3cff7af9adaf77161b (diff) | |
【重要Bug修复】延迟删除机制与Rulescan延迟更新机制发生冲突。当两次删除配置删除间隔小于rulescan延迟更新时间时,会导致扫描线程访问已释放的group_rule,轻则崩溃,重则思索。v1.9
| -rw-r--r-- | src/entry/Maat_rule.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/entry/Maat_rule.cpp b/src/entry/Maat_rule.cpp index dd9afb8..2c5d9d3 100644 --- a/src/entry/Maat_rule.cpp +++ b/src/entry/Maat_rule.cpp @@ -2623,7 +2623,7 @@ void garbage_bagging(enum maat_garbage_type type,void *p,MESA_lqueue_head garbag MESA_lqueue_join_tail(garbage_q,&bag,sizeof(void*)); return; } -void garbage_bury(MESA_lqueue_head garbage_q,void *logger) +void garbage_bury(MESA_lqueue_head garbage_q,int timeout,void *logger) { MESA_queue_errno_t q_ret=MESA_QUEUE_RET_OK; _maat_garbage_t* bag=NULL; @@ -2638,7 +2638,7 @@ void garbage_bury(MESA_lqueue_head garbage_q,void *logger) data_size=sizeof(void*); q_ret=(MESA_queue_errno_t)MESA_lqueue_get_head(garbage_q,&bag,&data_size); assert(data_size==sizeof(void*)&&q_ret==MESA_QUEUE_RET_OK); - if(now-bag->create_time<10) + if(now-bag->create_time<timeout) { MESA_lqueue_join_tail(garbage_q,&bag,sizeof(void*)); continue; @@ -3042,7 +3042,7 @@ void *thread_rule_monitor(void *arg) feather->scanner->version,feather->scanner->cfg_num); } } - garbage_bury(feather->garbage_q,feather->logger); + garbage_bury(feather->garbage_q,feather->effect_interval_ms/1000+10,feather->logger); if(feather->stat_on==1&&scan_dir_cnt%2==0)//output every 2 seconds { maat_stat_output(feather); @@ -3051,7 +3051,7 @@ void *thread_rule_monitor(void *arg) MESA_htable_destroy(feather->map_tablename2id,free); destroy_maat_scanner(feather->scanner); - garbage_bury(feather->garbage_q,feather->logger); + garbage_bury(feather->garbage_q,feather->effect_interval_ms/1000+10,feather->logger); MESA_lqueue_destroy(feather->garbage_q,lqueue_destroy_cb,NULL); FS_stop(&(feather->stat_handle)); |
