mirror of
https://github.com/minio/minio.git
synced 2025-11-21 18:26:04 -05:00
Avoid select inside a recursive function to avoid CPU spikes (#8923)
Additionally also allow configurable go-routines
This commit is contained in:
13
cmd/fs-v1.go
13
cmd/fs-v1.go
@@ -19,7 +19,6 @@ package cmd
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
@@ -226,18 +225,10 @@ func (fs *FSObjects) StorageInfo(ctx context.Context) StorageInfo {
|
||||
return storageInfo
|
||||
}
|
||||
|
||||
func (fs *FSObjects) waitForLowActiveIO() error {
|
||||
func (fs *FSObjects) waitForLowActiveIO() {
|
||||
for atomic.LoadInt64(&fs.activeIOCount) >= fs.maxActiveIOCount {
|
||||
select {
|
||||
case <-GlobalServiceDoneCh:
|
||||
return errors.New("forced exit")
|
||||
case <-time.NewTimer(lowActiveIOWaitTick).C:
|
||||
continue
|
||||
}
|
||||
time.Sleep(lowActiveIOWaitTick)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
}
|
||||
|
||||
// CrawlAndGetDataUsage returns data usage stats of the current FS deployment
|
||||
|
||||
Reference in New Issue
Block a user