From e3f67ae38517a01d192e5e8bd6d31eafa9f65f3c Mon Sep 17 00:00:00 2001 From: Will Rouesnel Date: Wed, 28 Jun 2017 14:28:37 +1000 Subject: [PATCH] Fix broken authoritative socket communications. --- pdns_exporter.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pdns_exporter.go b/pdns_exporter.go index cbbf5c2..7b4efc9 100644 --- a/pdns_exporter.go +++ b/pdns_exporter.go @@ -393,6 +393,9 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) { log.Errorln("read:", err) readResult <- 1 return + } else if err == io.EOF { + readResult <- 0 + return } if n == 0 { readResult <- 1 @@ -430,10 +433,12 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) { select { case <-timeoutCh: + log.Errorln("timeout waiting for powerdns response") e.error.Set(1) return case result := <-readResult: if result > 0 { + log.Errorln("error in read response: status", result) e.error.Set(1) return }