projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
I realize now that the problem is the line
[rrdtool.git]
/
src
/
rrd_daemon.c
diff --git
a/src/rrd_daemon.c
b/src/rrd_daemon.c
index
d404e04
..
7201c52
100644
(file)
--- a/
src/rrd_daemon.c
+++ b/
src/rrd_daemon.c
@@
-564,6
+564,7
@@
static void wipe_ci_values(cache_item_t *ci, time_t when)
static void remove_from_queue(cache_item_t *ci) /* {{{ */
{
if (ci == NULL) return;
static void remove_from_queue(cache_item_t *ci) /* {{{ */
{
if (ci == NULL) return;
+ if ((ci->flags & CI_FLAGS_IN_QUEUE) == 0) return; /* not queued */
if (ci->prev == NULL)
cache_queue_head = ci->next; /* reset head */
if (ci->prev == NULL)
cache_queue_head = ci->next; /* reset head */
@@
-625,9
+626,8
@@
static int enqueue_cache_item (cache_item_t *ci, /* {{{ */
if (cache_queue_head == ci)
return 0;
if (cache_queue_head == ci)
return 0;
- /* remove from the double linked list */
- if (ci->flags & CI_FLAGS_IN_QUEUE)
- remove_from_queue(ci);
+ /* remove if further down in queue */
+ remove_from_queue(ci);
ci->prev = NULL;
ci->next = cache_queue_head;
ci->prev = NULL;
ci->next = cache_queue_head;
@@
-681,20
+681,20
@@
static gboolean tree_callback_flush (gpointer key, gpointer value, /* {{{ */
ci = (cache_item_t *) value;
cfd = (callback_flush_data_t *) data;
ci = (cache_item_t *) value;
cfd = (callback_flush_data_t *) data;
+ if (ci->flags & CI_FLAGS_IN_QUEUE)
+ return FALSE;
+
if ((ci->last_flush_time <= cfd->abs_timeout)
if ((ci->last_flush_time <= cfd->abs_timeout)
- && ((ci->flags & CI_FLAGS_IN_QUEUE) == 0)
&& (ci->values_num > 0))
{
enqueue_cache_item (ci, TAIL);
}
else if ((do_shutdown != 0)
&& (ci->values_num > 0))
{
enqueue_cache_item (ci, TAIL);
}
else if ((do_shutdown != 0)
- && ((ci->flags & CI_FLAGS_IN_QUEUE) == 0)
&& (ci->values_num > 0))
{
enqueue_cache_item (ci, TAIL);
}
else if (((cfd->now - ci->last_flush_time) >= config_flush_interval)
&& (ci->values_num > 0))
{
enqueue_cache_item (ci, TAIL);
}
else if (((cfd->now - ci->last_flush_time) >= config_flush_interval)
- && ((ci->flags & CI_FLAGS_IN_QUEUE) == 0)
&& (ci->values_num <= 0))
{
char **temp;
&& (ci->values_num <= 0))
{
char **temp;
@@
-1450,6
+1450,7
@@
static int handle_request_update (listen_socket_t *sock, /* {{{ */
wipe_ci_values(ci, now);
ci->flags = CI_FLAGS_IN_TREE;
wipe_ci_values(ci, now);
ci->flags = CI_FLAGS_IN_TREE;
+ pthread_cond_init(&ci->flushed, NULL);
pthread_mutex_lock(&cache_lock);
g_tree_insert (cache_tree, (void *) ci->file, (void *) ci);
pthread_mutex_lock(&cache_lock);
g_tree_insert (cache_tree, (void *) ci->file, (void *) ci);