[BUGFIX]fix xx_plugin user_tag lifecycle

This commit is contained in:
liuwentan
2023-10-09 15:15:05 +08:00
parent 01c290e509
commit f09aa3e1fe
12 changed files with 67 additions and 156 deletions

View File

@@ -34,11 +34,12 @@ struct fqdn_plugin_schema {
struct fqdn_plugin_runtime {
struct FQDN_engine *engine;
struct ex_data_runtime *ex_data_rt;
long long rule_num;
long long update_err_cnt;
size_t n_worker_thread;
struct maat_garbage_bin *ref_garbage_bin;
struct log_handle *logger;
long long rule_num;
long long update_err_cnt;
};
void *fqdn_plugin_schema_new(cJSON *json, struct table_manager *tbl_mgr,
@@ -455,11 +456,9 @@ int fqdn_plugin_runtime_commit(void *fqdn_plugin_runtime, const char *table_name
return 0;
}
ex_data_runtime_commit(ex_data_rt);
struct FQDN_rule *rules = NULL;
struct ex_container **ex_container = NULL;
size_t rule_cnt = ex_data_runtime_list_ex_container(ex_data_rt, &ex_container);
size_t rule_cnt = ex_data_runtime_list_updating_ex_container(ex_data_rt, &ex_container);
if (rule_cnt > 0) {
rules = ALLOC(struct FQDN_rule, rule_cnt);
for (size_t i = 0; i < rule_cnt; i++) {
@@ -490,6 +489,8 @@ int fqdn_plugin_runtime_commit(void *fqdn_plugin_runtime, const char *table_name
old_fqdn_engine = fqdn_plugin_rt->engine;
fqdn_plugin_rt->engine = new_fqdn_engine;
ex_data_runtime_commit(ex_data_rt);
if (old_fqdn_engine != NULL) {
maat_garbage_bagging(fqdn_plugin_rt->ref_garbage_bin, old_fqdn_engine, NULL,
garbage_fqdn_engine_free);