Skip to content

Commit

Permalink
Fix broken authoritative socket communications.
Browse files Browse the repository at this point in the history
  • Loading branch information
wrouesnel committed Jun 28, 2017
1 parent abd6a7f commit e3f67ae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pdns_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit e3f67ae

Please sign in to comment.