moby/daemon/logger
Brian Goff 84e60a7e10 Fix issues with tailing rotated jsonlog file
Fixes a race where the log reader would get events for both an actual
rotation as we from fsnotify (`fsnotify.Rename`).
This issue becomes extremely apparent when rotations are fast, for
example:

```
$ docker run -d --name test --log-opt max-size=1 --log-opt max-file=2
busybox sh -c 'while true; do echo hello; usleep 100000; done'
```

With this change the log reader for jsonlogs can handle rotations that
happen as above.

Instead of listening for both fs events AND rotation events
simultaneously, potentially meaning we see 2 rotations for only a single
rotation due to channel buffering, only listen for fs events (like
`Rename`) and then wait to be notified about rotation by the logger.
This makes sure that we don't see 2 rotations for 1, and that we don't
start trying to read until the logger is actually ready for us to.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-08-15 13:57:28 -04:00
..
awslogs Fix build errors caused by update aws-sdk-go to v1.1.30 2016-05-28 18:49:17 -07:00
etwlogs fix typos 2016-06-02 17:17:22 +08:00
fluentd Remove docker/ prefix from log messages tag. 2016-05-12 22:29:30 -07:00
gcplogs Do not call out to Google on init 2016-03-17 11:06:21 -04:00
gelf Remove deprecated driver specific log tags 2016-05-10 07:43:44 -07:00
journald Add support for reading journal extras and in UTC 2016-06-02 10:17:07 -04:00
jsonfilelog Fix issues with tailing rotated jsonlog file 2016-08-15 13:57:28 -04:00
loggerutils Remove docker/ prefix from log messages tag. 2016-05-12 22:29:30 -07:00
splunk 1.change validateNoSchema into validateNoScheme 2016-03-31 12:29:15 +08:00
syslog Remove docker/ prefix from log messages tag. 2016-05-12 22:29:30 -07:00
context.go Remove docker/ prefix from log messages tag. 2016-05-12 22:29:30 -07:00
copier.go daemon/logger: fix races in channel close 2016-06-27 14:14:23 -07:00
copier_test.go Remove the logger.Message ContainerID field 2016-05-31 16:41:29 -04:00
factory.go inherit the daemon log options when creating containers 2016-05-02 23:04:04 +08:00
logger.go daemon/logger: fix races in channel close 2016-06-27 14:14:23 -07:00