summaryrefslogtreecommitdiffstats
path: root/libnetdata/dictionary
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-26 17:10:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-26 17:10:03 +0000
commit271f618a49421e87945c1f68b59a8775469390d5 (patch)
tree166cbc9497e13b878bdd7043ca58f6b3da006f2a /libnetdata/dictionary
parentAdding upstream version 1.43.0. (diff)
downloadnetdata-271f618a49421e87945c1f68b59a8775469390d5.tar.xz
netdata-271f618a49421e87945c1f68b59a8775469390d5.zip
Adding upstream version 1.43.1.upstream/1.43.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libnetdata/dictionary')
-rw-r--r--libnetdata/dictionary/dictionary.c13
-rw-r--r--libnetdata/dictionary/dictionary.h2
2 files changed, 13 insertions, 2 deletions
diff --git a/libnetdata/dictionary/dictionary.c b/libnetdata/dictionary/dictionary.c
index a74a59583..2d5313c39 100644
--- a/libnetdata/dictionary/dictionary.c
+++ b/libnetdata/dictionary/dictionary.c
@@ -137,6 +137,7 @@ struct dictionary {
const char *creation_function;
const char *creation_file;
size_t creation_line;
+ pid_t creation_tid;
#endif
usec_t last_gc_run_us;
@@ -1873,6 +1874,7 @@ void cleanup_destroyed_dictionaries(void) {
size_t line = dict->creation_line;
const char *file = dict->creation_file;
const char *function = dict->creation_function;
+ pid_t pid = dict->creation_tid;
#endif
DICTIONARY_STATS_DICT_DESTROY_QUEUED_MINUS1(dict);
@@ -1880,13 +1882,19 @@ void cleanup_destroyed_dictionaries(void) {
internal_error(
true,
- "DICTIONARY: freed dictionary with delayed destruction, created from %s() %zu@%s.",
- function, line, file);
+ "DICTIONARY: freed dictionary with delayed destruction, created from %s() %zu@%s pid %d.",
+ function, line, file, pid);
if(last) last->next = next;
else dictionaries_waiting_to_be_destroyed = next;
}
else {
+
+ internal_error(
+ true,
+ "DICTIONARY: cannot free dictionary with delayed destruction, created from %s() %zu@%s pid %d.",
+ function, line, file, pid);
+
DICTIONARY_STATS_DICT_DESTROY_QUEUED_PLUS1(dict);
last = dict;
}
@@ -2085,6 +2093,7 @@ DICTIONARY *dictionary_create_view(DICTIONARY *master) {
dict->creation_function = function;
dict->creation_file = file;
dict->creation_line = line;
+ dict->creation_tid = gettid();
#endif
DICTIONARY_STATS_DICT_CREATIONS_PLUS1(dict);
diff --git a/libnetdata/dictionary/dictionary.h b/libnetdata/dictionary/dictionary.h
index 72efe1d03..391be4ee5 100644
--- a/libnetdata/dictionary/dictionary.h
+++ b/libnetdata/dictionary/dictionary.h
@@ -162,6 +162,8 @@ void dictionary_version_increment(DICTIONARY *dict);
void dictionary_garbage_collect(DICTIONARY *dict);
+void cleanup_destroyed_dictionaries(void);
+
// ----------------------------------------------------------------------------
// Set an item in the dictionary
//