mirror of
https://github.com/minio/minio.git
synced 2026-11-17 06:55:18 +00:00
Avoid select inside a recursive function to avoid CPU spikes (#8923)
Additionally also allow configurable go-routines
This commit is contained in:
1 parent
9bbf5cb74f
commit
2d295a31de
4 files changed
+54
-97
No files matched your search
+2
-8
@@ -333,16 +333,10 @@ func isQuitting(endCh chan struct{}) bool {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *posix) waitForLowActiveIO() error {
|
||||
func (s *posix) waitForLowActiveIO() {
|
||||
for atomic.LoadInt32(&s.activeIOCount) >= s.maxActiveIOCount {
|
||||
select {
|
||||
case <-GlobalServiceDoneCh:
|
||||
return errors.New("forced exit")
|
||||
case <-time.NewTimer(lowActiveIOWaitTick).C:
|
||||
continue
|
||||
}
|
||||
time.Sleep(lowActiveIOWaitTick)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *posix) CrawlAndGetDataUsage(endCh <-chan struct{}) (DataUsageInfo, error) {
|
||||
|
||||
Reference in new issue
Block a user