[rrd-developers] rrd_graph fetch error handling and rrd_damon

Thorsten von Eicken tve at voneicken.com
Fri Jul 9 19:07:01 CEST 2010


I'm in the process of adding special error handling to rrd_client in 
order to be able to deal with more error situations when fetching data 
from a large number of remote rrdcached's. One issue I'm bumping into is 
this code in data_fetch (summarized):
             rrdc_connect (rrd_daemon);
             if (rrdc_is_connected (rrd_daemon))
                 status = rrdc_fetch (im->gdes[i].rrd,
             else
                 if ((rrd_fetch_fn(im->gdes[i].rrd,
this has the effect that if the connection fails it "falls back" to 
local file access, which makes no sense to me. If a data series is 
supposed to come from the daemon then what is the use-case for 
retrieving "some" local data from a file that happens to have the same 
pathname? I would much rather see this code look like:
     if(rrd_daemon != NULL)
         fetch remotely and error if it fails
     else
         fetch data locally and error if it fails
     end
Is there something I'm missing?
Thanks!
Thorsten

NB: some of the things we're working on is having explicit timeouts for 
remote connections and being able to fill the dataset with NaN if the 
remote fetch fails. The motivation is that we're producing graphs that 
may retrieve more than 100 remote RRDs from potentially as many 
rrdcached servers and throwing the whole graph down the drain if just 
one doesn't respond obviously doesn't work. We're also looking into 
using libevent to run all the connections in data_fetch in parallel, 
which would be really sweet.



More information about the rrd-developers mailing list