prometheus/prometheus — pull request #82 by juliusv (2013-02-21 18:54:24+00:00)
Title: Fix target pool deadlock and health checking bugs

This fixes two bugs, one of which masked the other.

- target.go: an "err" variable used to communicate between two closures was shadowed within the first closure, so effectively we never reported scrape failures and never did incremental scrape backoffs.

- targetpool.go: this bug only becomes visible once the first one is fixed. If there is a backend in the heap which cannot be scheduled right now, we "break" out of the scrape loop, but the "finished" channel synchronization after the loop then blocks forever, because we didn't scrape `targetCount` targets.