collectd/collectd — Issue #5: AMQP plugin: Consumer part of the plugin does not reconnect
Author: octo
Created: 2012-02-19 11:35:43+00:00
State: open

From: Xavier (Mantis #52)

**Description:** Due to a little mistake the AMQP plugin does not reconnect when a connection is lost.
**Steps To Reproduce:** Restart the AMQP backend and "wait" for Collectd to reconnect → It happens after 10K seconds !!!

Here is a little patch to fix this issue:

@@ -553,7 +555,7 @@ static void *camqp_subscribe_thread (void *user_data) /* {{{ */
ERROR ("amqp plugin: camqp_connect failed. "
"Will sleep for %.3f seconds.",
CDTIME_T_TO_DOUBLE (interval_g));
- sleep (interval_g);
+ sleep ((uint)CDTIME_T_TO_DOUBLE(interval_g));
continue;
}

@@ -564,7 +566,7 @@ static void *camqp_subscribe_thread (void *user_data) /* {{{ */
"Will sleep for %.3f seconds.",
CDTIME_T_TO_DOUBLE (interval_g));
camqp_close_connection (conf);
- sleep (interval_g);
+ sleep ((uint)CDTIME_T_TO_DOUBLE(interval_g));
continue;
}