Skip to content

Commit

Permalink
Merge pull request #1014 from weaveworks/977-docker-event-crash
Browse files Browse the repository at this point in the history
Handle closing of docker events channel gracefully
  • Loading branch information
paulbellamy committed Feb 24, 2016
2 parents 6b9daa7 + 2982166 commit fbe5671
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion probe/docker/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit fbe5671

Please sign in to comment.