summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Scott <peter@greplin.com>2013-03-21 18:04:25 -0700
committerPeter Scott <peter@greplin.com>2013-03-21 18:04:25 -0700
commit366241a820b1768fcd72d05076baaa27ce2edcb1 (patch)
tree4e975b6153b7d26c33aa358dcb2f14ce583a9a99
parent7448dd9ec91445a3379ee835bfb0c9ccca3c4bb1 (diff)
downloadlogster-366241a820b1768fcd72d05076baaa27ce2edcb1.zip
logster-366241a820b1768fcd72d05076baaa27ce2edcb1.tar.gz
logster-366241a820b1768fcd72d05076baaa27ce2edcb1.tar.bz2
Write all data to graphite socket.
The socket.send() method does not guarantee that all data will be sent. Either use socket.sendall() instead, or check the return value from send() and loop to send all the data. This is a nasty cause of intermittent, hard-to-find bugs.
-rwxr-xr-xbin/logster2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/logster b/bin/logster
index 4bc1f62..a0f31de 100755
--- a/bin/logster
+++ b/bin/logster
@@ -207,7 +207,7 @@ def submit_graphite(metrics, options):
logger.debug("Submitting Graphite metric: %s" % metric_string)
if (not options.dry_run):
- s.send("%s\n" % metric_string)
+ s.sendall("%s\n" % metric_string)
else:
print "%s %s" % (options.graphite_host, metric_string)