[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

@@ -33,11 +33,11 @@ struct bool_plugin_schema {
struct bool_plugin_runtime {
struct bool_matcher *matcher;
struct ex_data_runtime *ex_data_rt;
long long rule_num;
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;
};
@@ -449,11 +449,9 @@ int bool_plugin_runtime_commit(void *bool_plugin_runtime, const char *table_name
return 0;
}
ex_data_runtime_commit(ex_data_rt);
struct bool_expr *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 bool_expr, rule_cnt);
for (size_t i = 0; i < rule_cnt; i++) {
@@ -485,6 +483,8 @@ int bool_plugin_runtime_commit(void *bool_plugin_runtime, const char *table_name
old_bool_matcher = bool_plugin_rt->matcher;
bool_plugin_rt->matcher = new_bool_matcher;
ex_data_runtime_commit(ex_data_rt);
if (old_bool_matcher != NULL) {
maat_garbage_bagging(bool_plugin_rt->ref_garbage_bin, old_bool_matcher, NULL,
garbage_bool_matcher_free);