1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/daemon/logger/loggerutils
Cory Snider 90c54320c8 daemon/logger: fix data race in LogFile
The log message's timestamp was being read after it was returned to the
pool. By coincidence the timestamp field happened to not be zeroed on
reset so much of the time things would work as expected. But if the
message value was to be taken back out of the pool before WriteLogEntry
returned, the timestamp recorded in the gzip header of compressed
rotated log files would be incorrect.

Make future use-after-put bugs fail fast by zeroing all fields of the
Message value, including the timestamp, when it is put into the pool.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2022-03-03 14:56:25 -05:00
..
cache api/types: hostconfig: fix LogMode enum 2021-08-06 19:05:58 +02:00
file_unix.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
file_windows.go Fix windows log file rotation with readers 2020-10-29 18:38:30 +00:00
file_windows_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
follow.go daemon/logger: refactor followLogs to write more unit tests 2021-12-27 09:11:12 -08:00
follow_test.go daemon/logger: replace flaky TestFollowLogsHandleDecodeErr 2021-12-27 09:11:46 -08:00
log_tag.go Add canonical import comment 2018-02-05 16:51:57 -05:00
log_tag_test.go Add canonical import comment 2018-02-05 16:51:57 -05:00
logfile.go daemon/logger: fix data race in LogFile 2022-03-03 14:56:25 -05:00
logfile_race_test.go daemon/logger: add test to detect data races 2022-03-03 14:56:25 -05:00
logfile_test.go daemon/logger: replace flaky TestFollowLogsHandleDecodeErr 2021-12-27 09:11:46 -08:00