Merge pull request #31070 from cpuguy83/31060_fix_log_read_spin

Fix cpu spin waiting for log write events
(cherry picked from commit 39851eac0c)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Brian Goff 2017-02-16 20:15:38 -05:00 committed by Sebastiaan van Stijn
parent 46af6a6a41
commit 671a4aa4a4
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -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