diff options
| author | liuchang <[email protected]> | 2024-04-24 08:16:57 +0000 |
|---|---|---|
| committer | liuchang <[email protected]> | 2024-04-24 08:16:57 +0000 |
| commit | d8d7f38efc0885f471905c8533ee060b5d6449e4 (patch) | |
| tree | 86720d59d5df91928d17f90b33cfa9267db328a1 /src | |
| parent | 56238be7018c22a5c5f48a9274b1e30e7df7ed57 (diff) | |
add dup key don't output fatal logv4.1.36
Diffstat (limited to 'src')
| -rw-r--r-- | src/maat_bool_plugin.c | 5 | ||||
| -rw-r--r-- | src/maat_expr.c | 5 | ||||
| -rw-r--r-- | src/maat_flag.c | 5 | ||||
| -rw-r--r-- | src/maat_fqdn_plugin.c | 5 | ||||
| -rw-r--r-- | src/maat_interval.c | 5 | ||||
| -rw-r--r-- | src/maat_ip.c | 5 | ||||
| -rw-r--r-- | src/maat_ip_plugin.c | 5 | ||||
| -rw-r--r-- | src/maat_ipport_plugin.c | 5 | ||||
| -rw-r--r-- | src/maat_plugin.c | 6 |
9 files changed, 29 insertions, 17 deletions
diff --git a/src/maat_bool_plugin.c b/src/maat_bool_plugin.c index 8a6f831..6249b96 100644 --- a/src/maat_bool_plugin.c +++ b/src/maat_bool_plugin.c @@ -258,8 +258,11 @@ bool_plugin_runtime_update_row(struct bool_plugin_runtime *bool_plugin_rt, struct ex_container *ex_container = ex_container_new(ex_data, (void *)expr); ret = ex_data_runtime_add_ex_container(ex_data_rt, key, key_len, ex_container); if (ret < 0) { + log_debug(bool_plugin_rt->logger, MODULE_BOOL_PLUGIN, + "[%s:%d]bool_plugin table:<%s> add key failed, " + "key:%s", __FUNCTION__, __LINE__, table_name, key); ex_container_free(ex_data_rt, ex_container); - return -1; + //don't return failed, ignore the case of adding duplicate keys } } diff --git a/src/maat_expr.c b/src/maat_expr.c index bf46ce0..bfc8859 100644 --- a/src/maat_expr.c +++ b/src/maat_expr.c @@ -601,7 +601,7 @@ static int expr_runtime_update_row(struct expr_runtime *expr_rt, char *key, //add ret = rcu_hash_add(expr_rt->item_hash, key, key_len, (void *)item); if (ret < 0) { - log_fatal(expr_rt->logger, MODULE_EXPR, + log_debug(expr_rt->logger, MODULE_EXPR, "[%s:%d] expr item(item_id:%lld) add to item_hash failed", __FUNCTION__, __LINE__, item->item_id); return -1; @@ -859,8 +859,7 @@ int expr_runtime_update(void *expr_runtime, void *expr_schema, if (expr_item != NULL) { expr_item_free(expr_item); } - expr_rt->update_err_cnt++; - return -1; + //don't return failed, ignore the case of adding duplicate keys } return 0; diff --git a/src/maat_flag.c b/src/maat_flag.c index 5697684..d22254e 100644 --- a/src/maat_flag.c +++ b/src/maat_flag.c @@ -264,7 +264,7 @@ static int flag_runtime_update_row(struct flag_runtime *flag_rt, char *key, //add ret = rcu_hash_add(flag_rt->item_hash, key, key_len, (void *)item); if (ret < 0) { - log_fatal(flag_rt->logger, MODULE_FLAG, + log_debug(flag_rt->logger, MODULE_FLAG, "[%s:%d] flag item(item_id:%lld) add to item_hash failed", __FUNCTION__, __LINE__, item->item_id); return -1; @@ -449,8 +449,7 @@ int flag_runtime_update(void *flag_runtime, void *flag_schema, if (flag_item != NULL) { flag_item_free(flag_item); } - flag_rt->update_err_cnt++; - return -1; + //don't return failed, ignore the case of adding duplicate keys } return 0; diff --git a/src/maat_fqdn_plugin.c b/src/maat_fqdn_plugin.c index e9f74f7..84a58ab 100644 --- a/src/maat_fqdn_plugin.c +++ b/src/maat_fqdn_plugin.c @@ -380,8 +380,11 @@ fqdn_plugin_runtime_update_row(struct fqdn_plugin_runtime *fqdn_plugin_rt, ret = ex_data_runtime_add_ex_container(ex_data_rt, key, key_len, ex_container); if (ret < 0) { + log_debug(fqdn_plugin_rt->logger, MODULE_FQDN_PLUGIN, + "[%s:%d]fqdn_plugin table:<%s> add key failed, " + "key:%s", __FUNCTION__, __LINE__, table_name, key); ex_container_free(ex_data_rt, ex_container); - return -1; + //don't return failed, ignore the case of adding duplicate keys } } diff --git a/src/maat_interval.c b/src/maat_interval.c index c25b16c..070c5d6 100644 --- a/src/maat_interval.c +++ b/src/maat_interval.c @@ -384,7 +384,7 @@ static int interval_runtime_update_row(struct interval_runtime *interval_rt, //add ret = rcu_hash_add(interval_rt->item_hash, key, key_len, (void *)item); if (ret < 0) { - log_fatal(interval_rt->logger, MODULE_INTERVAL, + log_debug(interval_rt->logger, MODULE_INTERVAL, "[%s:%d] interval item(item_id:%lld) add to " "interavl_item_hash failed", __FUNCTION__, __LINE__, item->item_id); @@ -448,8 +448,7 @@ int interval_runtime_update(void *interval_runtime, void *interval_schema, if (interval_item != NULL) { interval_item_free(interval_item); } - interval_rt->update_err_cnt++; - return -1; + //don't return failed, ignore the case of adding duplicate keys } return 0; diff --git a/src/maat_ip.c b/src/maat_ip.c index 2f38b98..9fa528f 100644 --- a/src/maat_ip.c +++ b/src/maat_ip.c @@ -423,7 +423,7 @@ static int ip_runtime_update_row(struct ip_runtime *ip_rt, char *key, size_t key // add ret = rcu_hash_add(ip_rt->item_hash, key, key_len, (void *)item); if (ret < 0) { - log_fatal(ip_rt->logger, MODULE_IP, + log_debug(ip_rt->logger, MODULE_IP, "[%s:%d] ip item(item_id:%lld) add to ip runtime htable failed", __FUNCTION__, __LINE__, item->item_id); return -1; @@ -480,8 +480,7 @@ int ip_runtime_update(void *ip_runtime, void *ip_schema, if (ip_item != NULL) { ip_item_free(ip_item); } - ip_rt->update_err_cnt++; - return -1; + //don't return failed, ignore the case of adding duplicate keys } return 0; diff --git a/src/maat_ip_plugin.c b/src/maat_ip_plugin.c index c2055dd..64b7752 100644 --- a/src/maat_ip_plugin.c +++ b/src/maat_ip_plugin.c @@ -385,8 +385,11 @@ ip_plugin_runtime_update_row(struct ip_plugin_runtime *ip_plugin_rt, ret = ex_data_runtime_add_ex_container(ex_data_rt, key, key_len, ex_container); if (ret < 0) { + log_debug(ip_plugin_rt->logger, MODULE_IP_PLUGIN, + "[%s:%d]ip_plugin table:<%s> add key failed, " + "key:%s", __FUNCTION__, __LINE__, table_name, key); ex_container_free(ex_data_rt, ex_container); - return -1; + //don't return failed, ignore the case of adding duplicate keys } } diff --git a/src/maat_ipport_plugin.c b/src/maat_ipport_plugin.c index 64e7b30..b953369 100644 --- a/src/maat_ipport_plugin.c +++ b/src/maat_ipport_plugin.c @@ -401,8 +401,11 @@ ipport_plugin_runtime_update_row(struct ipport_plugin_runtime *ipport_plugin_rt, ret = ex_data_runtime_add_ex_container(ex_data_rt, key, key_len, ex_container); if (ret < 0) { + log_debug(ipport_plugin_rt->logger, MODULE_IPPORT_PLUGIN, + "[%s:%d]ipport_plugin table:<%s> add key failed, " + "key:%s", __FUNCTION__, __LINE__, table_name, key); ex_container_free(ex_data_rt, ex_container); - return -1; + //don't return failed, ignore the case of adding duplicate keys } } diff --git a/src/maat_plugin.c b/src/maat_plugin.c index 6dd3f3d..2f0d964 100644 --- a/src/maat_plugin.c +++ b/src/maat_plugin.c @@ -368,8 +368,12 @@ static int plugin_runtime_update_row(struct plugin_runtime *plugin_rt, ret = ex_data_runtime_add_ex_container(plugin_rt->ex_data_rt, key, key_len, ex_container); if (ret < 0) { + log_debug(plugin_rt->logger, MODULE_PLUGIN, + "[%s:%d]plugin table:<%s> add key failed, " + "key:%s", __FUNCTION__, __LINE__, table_name, key); ex_container_free(plugin_rt->ex_data_rt, ex_container); - return -1; + //don't return failed, ignore the case of adding duplicate keys + return 0; } } } |
