Skip to content

Commit

Permalink
Remove gomaxprocs from core.yaml (peer config)
Browse files Browse the repository at this point in the history
The go runtime already honors the GOMAXPROCS environment variable so
this adds no capability but can unintentionally override the documented
go behavior.

FAB-16747 #done

Change-Id: Idc86d2af5a7bb305bdb80ea390a82720aef9f422
Signed-off-by: Matthew Sykes <[email protected]>
  • Loading branch information
sykesm committed Oct 2, 2019
1 parent 73fafab commit f171a91
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 16 deletions.
2 changes: 0 additions & 2 deletions core/chaincode/chaincodetest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ peer:

# Peer port to accept connections on
port: 21212
# Setting for runtime.GOMAXPROCS(n). If n < 1, it does not change the current setting
gomaxprocs: -1
workers: 2

# Sync related configuration
Expand Down
2 changes: 1 addition & 1 deletion core/common/validation/statebased/vpmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ func TestForRaces(t *testing.T) {

// scenario to stress test the parallel validation
// this is an extended combined test
// run with go test -race and GOMAXPROCS >> 1
// run with go test -race

vpMetadataKey := pb.MetaDataKeys_VALIDATION_PARAMETER.String()
spe := cauthdsl.SignedByMspMember("foo")
Expand Down
5 changes: 0 additions & 5 deletions core/testutil/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"flag"
"fmt"
"io/ioutil"
"runtime"
"strings"

"github.com/hyperledger/fabric/bccsp/factory"
Expand Down Expand Up @@ -42,10 +41,6 @@ func SetupTestConfig() {
panic(fmt.Errorf("Fatal error config file: %s \n", err))
}

// Set the number of maxprocs
var numProcsDesired = viper.GetInt("peer.gomaxprocs")
configLogger.Debugf("setting Number of procs to %d, was %d\n", numProcsDesired, runtime.GOMAXPROCS(numProcsDesired))

// Init the BCCSP
var bccspConfig *factory.FactoryOpts
err = viper.UnmarshalKey("peer.BCCSP", &bccspConfig)
Expand Down
1 change: 0 additions & 1 deletion integration/nwo/core_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ peer:
addressAutoDetect: true
listenAddress: 127.0.0.1:{{ .PeerPort Peer "Listen" }}
chaincodeListenAddress: 0.0.0.0:{{ .PeerPort Peer "Chaincode" }}
gomaxprocs: -1
keepalive:
minInterval: 60s
client:
Expand Down
3 changes: 0 additions & 3 deletions internal/peer/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"fmt"
"io/ioutil"
"os"
"runtime"
"strings"
"time"

Expand Down Expand Up @@ -318,6 +317,4 @@ func InitCmd(cmd *cobra.Command, args []string) {
mainLogger.Errorf("Cannot run peer because %s", err.Error())
os.Exit(1)
}

runtime.GOMAXPROCS(viper.GetInt("peer.gomaxprocs"))
}
4 changes: 0 additions & 4 deletions sampleconfig/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ peer:
# This case is useful for docker containers.
addressAutoDetect: false

# Setting for runtime.GOMAXPROCS(n). If n < 1, it does not change the
# current setting
gomaxprocs: -1

# Keepalive settings for peer server and clients
keepalive:
# Interval is the duration after which if the server does not see
Expand Down

0 comments on commit f171a91

Please sign in to comment.