[rrd-users] Ruby bindings sticky error with xport

Troex Nevelin list at mrtech.ru
Wed Jul 27 19:49:26 CEST 2011


I've checked the latest trunk code, and no changes to
bindings/ruby/main.c has been made from at least 1.4.3 release.

I made a patch that fixes my problem
http://trash.mrtech.ru/~junkyard/tmp/rrdtool-ruby-xport-reset-state.patch

The similar bug was fixed for rb_rrd_infocall before:
http://oss.oetiker.ch/rrdtool-trac/changeset/2022/trunk/program/bindings/ruby/main.c

--
--- rrdtool-1.4.5.orig/bindings/ruby/main.c     2010-09-28 
18:44:19.000000000 +0300
+++ rrdtool-1.4.5/bindings/ruby/main.c  2011-07-27 19:28:28.000000000 +0300
@@ -333,6 +333,7 @@
      time_t start, end;

      a = string_arr_new(args);
+    reset_rrd_state();
      rrd_xport(a.len, a.strings, &xxsize, &start, &end, &step, 
&col_cnt, &legend_v, &data);
      string_arr_delete(a);



On 27/07/2011 01:20, Tobias Oetiker wrote:
> Hi Troex,
>
> make sure to have a look at the latest stable snapshot, I think
> there are some ruby bindiToday Troex Nevelin wrote:
>
>> Hello,
>>
>> I'm using ruby bindings to xport data from Munin RRDs insidng
>> fixes
>
>
> cheers
> tobi
>
>
> e rails app.
>> Everything works fine until I get first error during RRD.xport. For example
>> rrd file is missing, or my DEF/CDEF are in wrong format - I get an Exception
>> - everything is okay this behaviour is correct, but when I run RRD.xport
>> again
>> with correct options inside same rails app (without restarting it) I always
>> get the same first Exception, so if my script reads 20 rrds and I got error
>> on 5th than the last 15 RRD will return the same error as 5th. I can get rid
>> of that Exception only if I restart my Rails app.
>>
>> How can I flush this error from RRD library without restarting?
>>
>> I've looked through bindings/ruby/main.c ... maybe `reset_rrd_state();`
>> should be used in `rb_rrd_xport` method as well? (I'm not familiar with C)
>>
>>
>>
>



More information about the rrd-users mailing list