hpcloud / tail

Go package for reading from continously updated files (tail -f)
MIT License
2.7k stars 502 forks source link

lost logs when append data quickly after truncate #145

Open HeChuanXUPT opened 6 years ago

HeChuanXUPT commented 6 years ago

config

tail.Config{
    Follow:    true,
    Poll:      true,
    ReOpen:    false,
    MustExist: true,
    Location: &tail.SeekInfo{0, os.SEEK_END}})

case 1, OK

$ echo "test log 1" >> test.log
$ >test.log
$ echo "test log 2" >> test.log

can get 2 lines

case 2, MISS

$ echo "test log 1" >> test.log
$ >test.log && echo "test log 2" >> test.log

will miss the second log

env

system:windows 7 64bit branch: master