1
0
mirror of https://github.com/docker/cli.git synced 2026-01-26 15:41:42 +03:00
Files
cli/components/engine/daemon
Brian Goff ab16b6c61a 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>
Upstream-commit: 84e60a7e10278e3acd2b783d0e6955dc5198b57c
Component: engine
2016-08-15 13:57:28 -04:00
..
2016-05-06 16:08:53 -07:00
2016-02-03 10:43:01 -08:00
2016-06-11 13:16:55 -07:00
2016-06-30 11:32:49 -07:00
2016-07-08 17:26:42 -07:00
2016-06-27 10:23:37 -07:00
2016-06-27 10:23:37 -07:00
2016-06-11 19:42:38 +02:00
2016-06-21 15:29:25 +08:00
2016-06-02 19:12:20 -07:00