From 2982166e03b02459e15e08d14e4ab3dbf8f033a9 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Tue, 23 Feb 2016 16:35:58 +0000 Subject: [PATCH] Handle closing of docker events channel gracefully --- probe/docker/registry.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/probe/docker/registry.go b/probe/docker/registry.go index c9e06c73bc..f17653e7be 100644 --- a/probe/docker/registry.go +++ b/probe/docker/registry.go @@ -161,7 +161,11 @@ func (r *registry) listenForEvents() bool { otherUpdates := time.Tick(r.interval) for { select { - case event := <-events: + case event, ok := <-events: + if !ok { + log.Errorf("docker registry: event listener unexpectedly disconnected") + return true + } r.handleEvent(event) case <-otherUpdates: