mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix cpu spin waiting for log write events
This loop is not ever going to return since it's never actually setting the `err` var except on the first iteration. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
9042dbdb3b
commit
7a179972ff
1 changed files with 5 additions and 2 deletions
|
@ -256,9 +256,12 @@ func followLogs(f *os.File, logWatcher *logger.LogWatcher, notifyRotate chan int
|
|||
|
||||
handleDecodeErr := func(err error) error {
|
||||
if err == io.EOF {
|
||||
for err := waitRead(); err != nil; {
|
||||
for {
|
||||
err := waitRead()
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
if err == errRetry {
|
||||
// retry the waitRead
|
||||
continue
|
||||
}
|
||||
return err
|
||||
|
|
Loading…
Add table
Reference in a new issue