- ERROR ("rrdcached plugin: rrdc_update (%s, [%s], 1) failed with "
- "status %i.",
- filename, values_array[0], status);
+ /* The RRD client lib does not provide any means for checking a
+ * connection, hence we'll have to retry upon failed operations. */
+ rrd_clear_error ();
+ status = rrdc_update (filename, /* values_num = */ 1, (void *) values_array);
+ if (status == 0)
+ break;
+
+ if (!retried)
+ {
+ retried = 1;
+ if (try_reconnect () == 0)
+ continue;
+ /* else: report the error and fail */
+ }
+
+ ERROR ("rrdcached plugin: rrdc_update (%s, [%s], 1) failed: %s (status=%i)",
+ filename, values_array[0], rrd_get_error (), status);