|
@@ -507,6 +507,15 @@ func (d *DockerSource) TailDocker(container *ContainerConfig, outChan chan types
|
|
|
linesRead.With(prometheus.Labels{"source": container.Name}).Inc()
|
|
|
outChan <- evt
|
|
|
d.logger.Debugf("Sent line to parsing: %+v", evt.Line.Raw)
|
|
|
+ case <-readerTomb.Dying():
|
|
|
+ //This case is to handle temporarly losing the connection to the docker socket
|
|
|
+ //The only known case currently is when using docker-socket-proxy (and maybe a docker daemon restart)
|
|
|
+ d.logger.Debugf("readerTomb dying for container %s, removing it from runningContainerState", container.Name)
|
|
|
+ delete(d.runningContainerState, container.ID)
|
|
|
+ //Also reset the Since to avoid re-reading logs
|
|
|
+ d.Config.Since = time.Now().UTC().Format(time.RFC3339)
|
|
|
+ d.containerLogsOptions.Since = d.Config.Since
|
|
|
+ return nil
|
|
|
}
|
|
|
}
|
|
|
}
|