Merge pull request #7877 from VladRassokhin/vmware-intense-cpu

Fix intense cpu usage in vmware plugin
This commit is contained in:
Megan Marsh 2019-07-16 14:14:53 -07:00 committed by GitHub
commit b4130fdd41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,6 @@ package common
import (
"fmt"
"io"
"log"
"math"
"net"
@ -1962,7 +1961,9 @@ func consumeFile(fd *os.File) (chan byte, sentinelSignaller) {
b := make([]byte, 1)
for {
_, err := fd.Read(b)
if err == io.EOF {
if err != nil {
// In case of any error we must stop
// ErrClosed may appear since file is closed and this goroutine still left running
break
}
fromfile <- b[0]