disabled charts where re-enabled; fixes #371
Costa Tsaousis committed
May 5, 2016 at 22:04 UTC
4bc22301f4c592ce8aed686019ea5a848f94def8
1 file changed
+6
-1
src/rrd.c
+6
-1
@@ -53,11 +53,13 @@ static int rrdset_compare(void* a, void* b) {
53
avl_tree rrdset_root_index = {
54
NULL,
55
rrdset_compare,
56
+#ifndef AVL_WITHOUT_PTHREADS
57
#ifdef AVL_LOCK_WITH_MUTEX
58
PTHREAD_MUTEX_INITIALIZER
59
#else
60
PTHREAD_RWLOCK_INITIALIZER
61
#endif
62
+#endif
63
};
64
65
#define rrdset_index_add(st) avl_insert(&rrdset_root_index, (avl *)(st))
@@ -94,11 +96,13 @@ static int rrdset_compare_name(void* a, void* b) {
96
avl_tree rrdset_root_index_name = {
97
NULL,
98
rrdset_compare_name,
99
+#ifndef AVL_WITHOUT_PTHREADS
100
#ifdef AVL_LOCK_WITH_MUTEX
101
PTHREAD_MUTEX_INITIALIZER
102
#else
103
PTHREAD_RWLOCK_INITIALIZER
104
#endif
105
+#endif
106
};
107
108
int rrdset_index_add_name(RRDSET *st) {
@@ -846,7 +850,8 @@ unsigned long long rrdset_done(RRDSET *st)
850
pthread_rwlock_rdlock(&st->rwlock);
851
852
// enable the chart, if it was disabled
849
- st->enabled = 1;
853
+ if(unlikely(rrd_delete_unupdated_dimensions) && !st->enabled)
854
+ st->enabled = 1;
855
856
// check if the chart has a long time to be updated
857
if(unlikely(st->usec_since_last_update > st->entries * st->update_every * 1000000ULL)) {