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.setNumbers = append(opts.setNumbers, i-1)
} }
opts.sleepDuration = time.Second
var err error var err error
if v := vars[healSleepDuration]; v != "" { if v := vars[healSleepDuration]; v != "" {
opts.sleepDuration, err = time.ParseDuration(v) opts.sleepDuration, err = time.ParseDuration(v)
if err != nil { if err != nil {
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL) writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
return return
} }
} else {
opts.sleepDuration = 100 * time.Millisecond
} }
opts.sleepForIO = 10
if v := vars[healSleepMaxIO]; v != "" { if v := vars[healSleepMaxIO]; v != "" {
opts.sleepForIO, err = strconv.Atoi(v) opts.sleepForIO, err = strconv.Atoi(v)
if err != nil { if err != nil {
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL) writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
return return
} }
} else {
opts.sleepForIO = 1000
} }
buckets, _ := objectAPI.ListBucketsHeal(ctx) buckets, _ := objectAPI.ListBucketsHeal(ctx)

View File

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

View File

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

View File

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