Code

Added debian/patches/memcached_timeout.dpatch.
authorSebastian Harl <sh@tokkee.org>
Wed, 17 Sep 2008 18:10:39 +0000 (20:10 +0200)
committerSebastian Harl <sh@tokkee.org>
Wed, 17 Sep 2008 18:10:39 +0000 (20:10 +0200)
Trivial upstream patch to fix the timeout passed to poll(2).

debian/changelog
debian/patches/00list
debian/patches/memcached_timeout.dpatch [new file with mode: 0755]

index 1f60063f261ee3f5aec98af371f16f11e22c757d..97ca2b47a3111757845d92a6a7164b996f9e4272 100644 (file)
@@ -12,8 +12,10 @@ collectd (4.4.2-2) unstable; urgency=low
     possible memory leak in the snmp plugin.
   * Added debian/patches/memcached_fdleak.dpatch - trivial upstream patch to
     fix a possible file descriptor leak in the memcached plugin.
+  * Added debian/patches/memcached_timeout.dpatch - trivial upstream patch to
+    fix the timeout passed to poll(2).
 
- -- Sebastian Harl <sh@tokkee.org>  Wed, 17 Sep 2008 19:29:55 +0200
+ -- Sebastian Harl <sh@tokkee.org>  Wed, 17 Sep 2008 20:08:55 +0200
 
 collectd (4.4.2-1) unstable; urgency=low
 
index 3a38f12ece54faa822c6269fb8f5e8220d2ee40f..c72403e1513ba3a31052bfcb3f208725d86da29f 100644 (file)
@@ -5,4 +5,5 @@ memory_libstatgrab.dpatch
 collectd_memleak.dpatch
 snmp_memleak.dpatch
 memcached_fdleak.dpatch
+memcached_timeout.dpatch
 
diff --git a/debian/patches/memcached_timeout.dpatch b/debian/patches/memcached_timeout.dpatch
new file mode 100755 (executable)
index 0000000..113cd74
--- /dev/null
@@ -0,0 +1,22 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## memcached_timeout.dpatch by Florian Forster <octo@verplant.org>
+##
+## DP: memcached plugin: Wait for a *little* longer for memcached to answer:
+## DP: poll(2) takes a timeout in milliseconds, not seconds. Also, use the
+## DP: global interval instead of some random number as timeout.
+## DP: (This is upstream Git commit 801067164e6eb068f5b5b2c45638fd207d5084ff)
+
+@DPATCH@
+
+diff a/src/memcached.c b/src/memcached.c
+--- a/src/memcached.c
++++ b/src/memcached.c
+@@ -134,7 +134,7 @@ static int memcached_query_daemon (char *buffer, int buffer_size) /* {{{ */
+               p.events = POLLIN|POLLERR|POLLHUP;
+               p.revents = 0;
+-              n = poll(&p, 1, 3);
++              n = poll(&p, 1, 1000 * interval_g);
+               if (n <= 0) {
+                       ERROR ("memcached: poll() failed or timed out");