[rrd-developers] [RRDtool Trac] #269: Daemon connection is not reopened on connection error (fwd)

Thorsten von Eicken tve at voneicken.com
Wed Jun 16 18:05:11 CEST 2010


On 6/16/2010 8:56 AM, Tobias Oetiker wrote:
> Yesterday Thorsten von Eicken wrote:
>
>    
>> Mhh, I used to have this problem but submitted a patch to rrd_client which
>> dealt with read errors on april 30th, which you incorporated. I haven't had a
>> problem since using collectd as client. Does the user use the latest version?
>> For my anything but trunk is unusable, sadly. Last rrdtool 1.4_rc2 is over a
>> year old, unless I'm missing something...
>>      
> you are using trunk because you are using the fetch stuff, right ?
> I am not using cached myself so I am only tracking what the actual
> users do ... can you send me a copy of the patch your think is
> responsible for the issue so that I can make sure I have backported
> it to mainline ...
>    
Yes, I'm using trunk to get the fetch stuff. Coolest thing happening to 
rrdtool in a long time IMHO ;-).
The old patch is below. It could well be that there is another similar 
spot left in the code...
     Thorsten

The patch below explicitly closes the connection on error in 
response_read. I've found it to get stuck otherwise.
     TvE

# diff -u rrd_client.c.orig rrd_client.c
--- rrd_client.c.orig   2010-03-29 17:03:57.000000000 +0000
+++ rrd_client.c        2010-04-20 22:10:28.000000000 +0000
@@ -371,14 +371,17 @@
    ret->lines_num = 0;

    buffer_ptr = fgets (buffer, sizeof (buffer), sh);
-  if (buffer_ptr == NULL)
+  if (buffer_ptr == NULL) {
+    close_connection();
      return (-3);
+  }
    chomp (buffer);

    ret->status = strtol (buffer, &ret->message, 0);
    if (buffer == ret->message)
    {
      response_free (ret);
+    close_connection();
      return (-4);
    }
    /* Skip leading whitespace of the status message */
@@ -396,6 +399,7 @@
    if (ret->lines == NULL)
    {
      response_free (ret);
+    close_connection();
      return (-5);
    }
    memset (ret->lines, 0, sizeof (char *) * ret->status);
@@ -407,6 +411,7 @@
      if (buffer_ptr == NULL)
      {
        response_free (ret);
+      close_connection();
        return (-6);
      }
      chomp (buffer);
@@ -415,6 +420,7 @@
      if (ret->lines[i] == NULL)
      {
        response_free (ret);
+      close_connection();
        return (-7);
      }
    }

> cheers
> tobi
>
>
>    
>>      TvE
>>
>> On 6/15/2010 9:01 PM, Tobias Oetiker wrote:
>>      
>>> rrdcached gurus ...
>>>
>>> #269: Daemon connection is not reopened on connection error
>>> -----------------------+----------------------------------------------------
>>>    Reporter:  human      |       Owner:  oetiker
>>>        Type:  defect     |      Status:  new
>>>    Priority:  major      |   Milestone:
>>> Component:  misc       |     Version:  1.4.2
>>>    Keywords:  rrdcached  |
>>> -----------------------+----------------------------------------------------
>>>    I have a long running application that uses RRD through the Python
>>>    bindings. After a rrdcached restart, the connection is lost and the
>>>    application never recovers.
>>>
>>>    Since the connection is managed by rrd itself, I cannot reset it even
>>>    though I know there is a problem.
>>>
>>>    It would be nice it rrd handled reopening the connection on error or
>>>    allowing the user to discard the existing connection.
>>>
>>>    Ticket URL:<http://oss.oetiker.ch/rrdtool-trac/ticket/269>
>>>
>>>
>>> anyone ?
>>>
>>> cheers
>>> tobi
>>>
>>> _______________________________________________
>>> rrd-developers mailing list
>>> rrd-developers at lists.oetiker.ch
>>> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
>>>
>>>
>>>        
>>
>>      
>    



More information about the rrd-developers mailing list