Skip to content

Commit

Permalink
Remove an unused config parameter from peer
Browse files Browse the repository at this point in the history
After the commit of 6c58b2, a config parameter
'DeliverClientKeepaliveOptions' is no longer used.

Signed-off-by: Nao Nishijima <nao.nishijima.xt@hitachi.com>
  • Loading branch information
naonishijima authored and denyeart committed May 12, 2022
1 parent f3a0d07 commit ccfa8a4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 44 deletions.
6 changes: 0 additions & 6 deletions core/deliverservice/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,6 @@ func (c *DeliverServiceConfig) loadDeliverServiceConfig() {
}

c.KeepaliveOptions = comm.DefaultKeepaliveOptions
if viper.IsSet("peer.keepalive.deliveryClient.interval") {
c.KeepaliveOptions.ClientInterval = viper.GetDuration("peer.keepalive.deliveryClient.interval")
}
if viper.IsSet("peer.keepalive.deliveryClient.timeout") {
c.KeepaliveOptions.ClientTimeout = viper.GetDuration("peer.keepalive.deliveryClient.timeout")
}

c.SecOpts = comm.SecureOptions{
UseTLS: viper.GetBool("peer.tls.enabled"),
Expand Down
6 changes: 2 additions & 4 deletions core/deliverservice/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ func TestGlobalConfig(t *testing.T) {
viper.Set("peer.deliveryclient.reConnectBackoffThreshold", "25s")
viper.Set("peer.deliveryclient.reconnectTotalTimeThreshold", "20s")
viper.Set("peer.deliveryclient.connTimeout", "10s")
viper.Set("peer.keepalive.deliveryClient.interval", "5s")
viper.Set("peer.keepalive.deliveryClient.timeout", "2s")

coreConfig := deliverservice.GlobalConfig()

Expand All @@ -98,8 +96,8 @@ func TestGlobalConfig(t *testing.T) {
ReconnectTotalTimeThreshold: 20 * time.Second,
ConnectionTimeout: 10 * time.Second,
KeepaliveOptions: comm.KeepaliveOptions{
ClientInterval: time.Second * 5,
ClientTimeout: time.Second * 2,
ClientInterval: time.Second * 60,
ClientTimeout: time.Second * 20,
ServerInterval: time.Hour * 2,
ServerTimeout: time.Second * 20,
ServerMinInterval: time.Minute,
Expand Down
12 changes: 0 additions & 12 deletions core/peer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ type Config struct {
// hardware threads on the machine.
ValidatorPoolSize int

// ----- Peer Delivery Client Keepalive -----
// DeliveryClient Keepalive settings for communication with ordering nodes.
DeliverClientKeepaliveOptions comm.KeepaliveOptions

// ----- Profile -----
// TODO: create separate sub-struct for Profile config.

Expand Down Expand Up @@ -271,14 +267,6 @@ func (c *Config) load() error {
c.ValidatorPoolSize = runtime.NumCPU()
}

c.DeliverClientKeepaliveOptions = comm.DefaultKeepaliveOptions
if viper.IsSet("peer.keepalive.deliveryClient.interval") {
c.DeliverClientKeepaliveOptions.ClientInterval = viper.GetDuration("peer.keepalive.deliveryClient.interval")
}
if viper.IsSet("peer.keepalive.deliveryClient.timeout") {
c.DeliverClientKeepaliveOptions.ClientTimeout = viper.GetDuration("peer.keepalive.deliveryClient.timeout")
}

c.GatewayOptions = gatewayconfig.GetOptions(viper.GetViper())

c.VMEndpoint = viper.GetString("vm.endpoint")
Expand Down
21 changes: 9 additions & 12 deletions core/peer/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ func TestGlobalConfig(t *testing.T) {
ChaincodeListenAddress: "0.0.0.0:7052",
ChaincodeAddress: "0.0.0.0:7052",
ValidatorPoolSize: 1,
DeliverClientKeepaliveOptions: comm.DefaultKeepaliveOptions,

VMEndpoint: "unix:///var/run/docker.sock",
VMDockerTLSEnabled: false,
Expand Down Expand Up @@ -402,12 +401,11 @@ func TestGlobalConfigDefault(t *testing.T) {
require.NoError(t, err)

expectedConfig := &Config{
AuthenticationTimeWindow: 15 * time.Minute,
PeerAddress: "localhost:8080",
ValidatorPoolSize: runtime.NumCPU(),
VMNetworkMode: "host",
DeliverClientKeepaliveOptions: comm.DefaultKeepaliveOptions,
GatewayOptions: config.GetOptions(viper.GetViper()),
AuthenticationTimeWindow: 15 * time.Minute,
PeerAddress: "localhost:8080",
ValidatorPoolSize: runtime.NumCPU(),
VMNetworkMode: "host",
GatewayOptions: config.GetOptions(viper.GetViper()),
}

require.Equal(t, expectedConfig, coreConfig)
Expand Down Expand Up @@ -438,11 +436,10 @@ func TestPropagateEnvironment(t *testing.T) {
require.NoError(t, err)

expectedConfig := &Config{
AuthenticationTimeWindow: 15 * time.Minute,
PeerAddress: "localhost:8080",
ValidatorPoolSize: runtime.NumCPU(),
VMNetworkMode: "host",
DeliverClientKeepaliveOptions: comm.DefaultKeepaliveOptions,
AuthenticationTimeWindow: 15 * time.Minute,
PeerAddress: "localhost:8080",
ValidatorPoolSize: runtime.NumCPU(),
VMNetworkMode: "host",
ExternalBuilders: []ExternalBuilder{
{
Name: "testName",
Expand Down
10 changes: 0 additions & 10 deletions sampleconfig/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,6 @@ peer:
# Timeout is the duration the client waits for a response from
# peer nodes before closing the connection
timeout: 20s
# DeliveryClient keepalive settings for communication with ordering
# nodes.
deliveryClient:
# Interval is the time between pings to ordering nodes. This must
# greater than or equal to the minInterval specified by ordering
# nodes.
interval: 60s
# Timeout is the duration the client waits for a response from
# ordering nodes before closing the connection
timeout: 20s


# Gossip related configuration
Expand Down

0 comments on commit ccfa8a4

Please sign in to comment.