Quellcode durchsuchen

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>
Hannu Nyman vor 9 Jahren
Ursprung
Commit
91041ead33
1 geänderte Dateien mit 12 neuen und 0 gelöschten Zeilen
  1. 12
    0
      utils/collectd/patches/300-delay-first-read-cycle.patch

+ 12
- 0
utils/collectd/patches/300-delay-first-read-cycle.patch Datei anzeigen

@@ -0,0 +1,12 @@
1
+--- a/src/daemon/plugin.c
2
++++ b/src/daemon/plugin.c
3
+@@ -1149,7 +1149,7 @@ static int plugin_insert_read (read_func
4
+ 	int status;
5
+ 	llentry_t *le;
6
+ 
7
+-	rf->rf_next_read = cdtime ();
8
++	rf->rf_next_read = cdtime () + (cdtime_t) 1073741824; //delay first read 1s
9
+ 	rf->rf_effective_interval = rf->rf_interval;
10
+ 
11
+ 	pthread_mutex_lock (&read_lock);
12
+