Fix crash when child connects (#14492)
* Just formatting * Remove single threaded * Only destroy if we are localhost (ie. shutdown)
Stelios Fragkakis committed
Feb 9, 2023 at 21:26 UTC
27795c8b938fa8d50d64208ca9b49ac0fca8153c
3 files changed
+5
-4
database/rrdhost.c
+2
-1
@@ -1226,7 +1226,8 @@ void rrdhost_free___while_having_rrd_wrlock(RRDHOST *host, bool force) {
1226
rrdfamily_index_destroy(host);
1227
rrdfunctions_destroy(host);
1228
rrdvariables_destroy(host->rrdvars);
1229
- rrdvariables_destroy(health_rrdvars);
1229
+ if (host == localhost)
1230
+ rrdvariables_destroy(health_rrdvars);
1231
1232
rrdhost_destroy_rrdcontexts(host);
1233
database/rrdvar.c
+1
-1
@@ -94,7 +94,7 @@ DICTIONARY *rrdvariables_create(void) {
94
}
95
96
DICTIONARY *health_rrdvariables_create(void) {
97
- DICTIONARY *dict = dictionary_create_advanced(DICT_OPTION_SINGLE_THREADED, &dictionary_stats_category_rrdhealth, 0);
97
+ DICTIONARY *dict = dictionary_create_advanced(DICT_OPTION_NONE, &dictionary_stats_category_rrdhealth, 0);
98
99
dictionary_register_insert_callback(dict, rrdvar_insert_callback, NULL);
100
dictionary_register_delete_callback(dict, rrdvar_delete_callback, NULL);
health/health.c
+2
-2
@@ -947,8 +947,8 @@ static void health_execute_delayed_initializations(RRDHOST *host) {
947
}
948
foreach_rrdcalctemplate_done(rt);
949
950
- if(health_variable_check(health_rrdvars, st, rd))
951
- rrdvar_store_for_chart(host, st);
950
+ if (health_variable_check(health_rrdvars, st, rd))
951
+ rrdvar_store_for_chart(host, st);
952
}
953
rrddim_foreach_done(rd);
954
}