summaryrefslogtreecommitdiffstats
path: root/libnetdata/dictionary
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2022-09-07 23:02:09 +0300
committerGitHub <noreply@github.com>2022-09-07 23:02:09 +0300
commit642e00348d5be1af256aef4ce0ff922ecf1d82e4 (patch)
tree21f8bbcf15cadfc707e476e33730704df6557e75 /libnetdata/dictionary
parent2cb23d5b81b3b0c90e0630eacff93e2ed4e79b81 (diff)
fix rrdcontexts left in the post-processing queue from the garbage collector (#13645)
* fix rrdcontexts left in the post-processing queue from the garbage collector * set the queuing flags atomically, using the dictionary callbacks
Diffstat (limited to 'libnetdata/dictionary')
-rw-r--r--libnetdata/dictionary/dictionary.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libnetdata/dictionary/dictionary.c b/libnetdata/dictionary/dictionary.c
index 4af2c391a3..259462e8b5 100644
--- a/libnetdata/dictionary/dictionary.c
+++ b/libnetdata/dictionary/dictionary.c
@@ -914,6 +914,10 @@ static NAME_VALUE *dictionary_set_name_value_unsafe(DICTIONARY *dict, const char
// so, either we will return the old one
// or overwrite the value, depending on dictionary flags
+ // We should not compare the values here!
+ // even if they are the same, we have to do the whole job
+ // so that the callbacks will be called.
+
nv = *pnv;
if(!(dict->flags & DICTIONARY_FLAG_DONT_OVERWRITE_VALUE)) {
@@ -927,7 +931,8 @@ static NAME_VALUE *dictionary_set_name_value_unsafe(DICTIONARY *dict, const char
}
else {
- // make sure this flag is not set
+ // we did really nothing!
+ // make sure this flag is not set.
nv->flags &= ~NAME_VALUE_FLAG_NEW_OR_UPDATED;
}
}