aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2015-10-07 12:51:33 +0300
committerHannu Nyman <hannu.nyman@iki.fi>2015-10-07 12:51:33 +0300
commit91041ead33655df6be8f4577efe35b8b8bddc870 (patch)
treef6e845d10a8fa57639e80e256ae29514bda740b2 /utils
parent1d853ac05ab118df2ad1a5628a4087661b5962a7 (diff)
collectd: Delay first data read cycle by 1s
Some collectd plugins launch third-party plugins that have variation in initialisation time (like libpcap). Recently (since kernel bump to 4.1) the DNS plugin has been causing collectd to crash semi-randomly at startup on MIPS based WNDR3700. Debugging led to realisation that the DNS plugin seems to require at least 0.1s time to start, before the first data reading attempt starts. By default, the first data read cycle starts immediately, while apaprently some of the plugins may still be asyncronously initialising. To make things safe, this patch adds 1 second delay before the first data read cycle. Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Diffstat (limited to 'utils')
-rw-r--r--utils/collectd/patches/300-delay-first-read-cycle.patch12
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/collectd/patches/300-delay-first-read-cycle.patch b/utils/collectd/patches/300-delay-first-read-cycle.patch
new file mode 100644
index 000000000..9a60cc464
--- /dev/null
+++ b/utils/collectd/patches/300-delay-first-read-cycle.patch
@@ -0,0 +1,12 @@
+--- a/src/daemon/plugin.c
++++ b/src/daemon/plugin.c
+@@ -1149,7 +1149,7 @@ static int plugin_insert_read (read_func
+ int status;
+ llentry_t *le;
+
+- rf->rf_next_read = cdtime ();
++ rf->rf_next_read = cdtime () + (cdtime_t) 1073741824; //delay first read 1s
+ rf->rf_effective_interval = rf->rf_interval;
+
+ pthread_mutex_lock (&read_lock);
+