remove GOMAXPROCS requirement

This commit is contained in:
Harshavardhana 2021-02-08 21:54:00 -08:00
parent 0615d85384
commit bc89e47066
4 changed files with 12 additions and 10 deletions

View file

@ -753,23 +753,26 @@ func (a adminAPIHandlers) HealSetsHandler(w http.ResponseWriter, r *http.Request
opts.setNumbers = append(opts.setNumbers, i-1)
}
opts.sleepDuration = time.Second
var err error
if v := vars[healSleepDuration]; v != "" {
opts.sleepDuration, err = time.ParseDuration(v)
if err != nil {
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
return
}
} else {
opts.sleepDuration = 100 * time.Millisecond
}
opts.sleepForIO = 10
if v := vars[healSleepMaxIO]; v != "" {
opts.sleepForIO, err = strconv.Atoi(v)
if err != nil {
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
return
}
} else {
opts.sleepForIO = 1000
}
buckets, _ := objectAPI.ListBucketsHeal(ctx)
@ -782,7 +785,9 @@ func (a adminAPIHandlers) HealSetsHandler(w http.ResponseWriter, r *http.Request
defer wg.Done()
lbDisks := z.serverSets[0].sets[setNumber].getDisks()
if err := healErasureSet(ctx, vars[healSetsPrefix], setNumber, opts.sleepForIO, opts.sleepDuration, buckets, lbDisks); err != nil {
logger.LogIf(ctx, err)
if !isErrBucketNotFound(err) {
logger.LogIf(ctx, err)
}
}
}(setNumber)
}

View file

@ -21,7 +21,6 @@ import (
"encoding/json"
"fmt"
"net/http"
"runtime"
"sync"
"time"
@ -421,7 +420,7 @@ func newHealSequence(ctx context.Context, bucket, objPrefix, clientAddr string,
clientToken := mustGetUUID()
return &healSequence{
respCh: make(chan healResult, runtime.GOMAXPROCS(0)),
respCh: make(chan healResult),
bucket: bucket,
object: objPrefix,
reportProgress: true,

View file

@ -19,7 +19,6 @@ package cmd
import (
"context"
"path"
"runtime"
"time"
"github.com/minio/minio/pkg/madmin"
@ -126,7 +125,7 @@ func (h *healRoutine) run(ctx context.Context, objAPI ObjectLayer) {
func newHealRoutine() *healRoutine {
return &healRoutine{
tasks: make(chan healTask, runtime.GOMAXPROCS(0)),
tasks: make(chan healTask),
doneCh: make(chan struct{}),
}

View file

@ -18,7 +18,6 @@ package cmd
import (
"context"
"runtime"
"sync"
"time"
@ -43,8 +42,8 @@ func newBgHealSequence() *healSequence {
}
return &healSequence{
sourceCh: make(chan healSource, runtime.GOMAXPROCS(0)),
respCh: make(chan healResult, runtime.GOMAXPROCS(0)),
sourceCh: make(chan healSource),
respCh: make(chan healResult),
startTime: UTCNow(),
clientToken: bgHealingUUID,
// run-background heal with reserved bucket