fh = fdopen (fd, "w");
if (fh == NULL)
{
- RRDD_LOG (LOG_ERR, "write_pidfile: fopen() failed.");
+ RRDD_LOG (LOG_ERR, "write_pidfile: fdopen() failed.");
close(fd);
return (-1);
}
if (did_insert)
{
+ pthread_cond_broadcast(&cache_cond);
pthread_mutex_lock (&stats_lock);
stats_queue_length++;
pthread_mutex_unlock (&stats_lock);
if (max_age > 0)
cfd.abs_timeout = cfd.now - max_age;
else
- cfd.abs_timeout = cfd.now + 1;
+ cfd.abs_timeout = cfd.now + 2*config_write_jitter + 1;
/* `tree_callback_flush' will return the keys of all values that haven't
* been touched in the last `config_flush_interval' seconds in `cfd'.
/* Enqueue at head */
enqueue_cache_item (ci, HEAD);
- pthread_cond_signal (&cache_cond);
pthread_cond_wait(&ci->flushed, &cache_lock);
pthread_mutex_unlock(&cache_lock);
&& (ci->values_num > 0))
{
enqueue_cache_item (ci, TAIL);
- pthread_cond_signal (&cache_cond);
}
pthread_mutex_unlock (&cache_lock);