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:
parent
46af6a6a41
commit
671a4aa4a4
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…
Reference in a new issue