add GOMAXPROCS back

This commit is contained in:
Harshavardhana 2021-02-08 22:25:59 -08:00
parent f07c9c58e7
commit fb78283c0a
4 changed files with 11 additions and 9 deletions

View File

@ -753,26 +753,23 @@ 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)

View File

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

View File

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

View File

@ -18,6 +18,7 @@ package cmd
import (
"context"
"runtime"
"sync"
"time"
@ -42,8 +43,8 @@ func newBgHealSequence() *healSequence {
}
return &healSequence{
sourceCh: make(chan healSource),
respCh: make(chan healResult),
sourceCh: make(chan healSource, runtime.GOMAXPROCS(0)),
respCh: make(chan healResult, runtime.GOMAXPROCS(0)),
startTime: UTCNow(),
clientToken: bgHealingUUID,
// run-background heal with reserved bucket
@ -180,6 +181,8 @@ func healErasureSet(ctx context.Context, prefix string, setIndex int, maxIO int,
for {
entry, quorumCount, ok := lexicallySortedEntryVersions(entryChs, entries, entriesValid)
if !ok {
logger.Info("Healing finished for bucket '%s' on erasure set %d", setIndex+1)
// We are finished with this bucket return.
return
}