Skip to content

Commit 577962e

Browse files
authored
Revert "Modify NSM internal GRPC connection parameters" (#1325)
1 parent bc1021c commit 577962e

File tree

5 files changed

+5
-22
lines changed

5 files changed

+5
-22
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ docker build .
2929
* `NSM_REGISTRY_CLIENT_POLICIES` - paths to files and directories that contain registry client policies
3030
* `NSM_LOG_LEVEL` - Log level
3131
* `NSM_DIAL_TIMEOUT` - Timeout for the dial the next endpoint
32-
* `NSM_DIAL_MAX_DELAY` - Upper bound on gRPC connection backoff delay
3332
* `NSM_OPEN_TELEMETRY_ENDPOINT` - OpenTelemetry Collector Endpoint
3433
* `NSM_METRICS_EXPORT_INTERVAL` - interval between mertics exports
3534
* `NSM_PPROF_ENABLED` - is pprof enabled (default: "false")

internal/config/config.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
// Copyright (c) 2025 Nordix and/or its affiliates.
2+
//
13
// Copyright (c) 2020-2025 Cisco and/or its affiliates.
24
//
35
// Copyright (c) 2021-2025 Doc.ai and/or its affiliates.
46
//
5-
// Copyright (c) 2025 OpenInfra Foundation Europe and/or its affiliates.
6-
//
77
// SPDX-License-Identifier: Apache-2.0
88
//
99
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -44,8 +44,7 @@ type Config struct {
4444
MaxTokenLifetime time.Duration `default:"10m" desc:"maximum lifetime of tokens" split_words:"true"`
4545
RegistryClientPolicies []string `default:"etc/nsm/opa/common/.*.rego,etc/nsm/opa/registry/.*.rego,etc/nsm/opa/client/.*.rego" desc:"paths to files and directories that contain registry client policies" split_words:"true"`
4646
LogLevel string `default:"INFO" desc:"Log level" split_words:"true"`
47-
DialTimeout time.Duration `default:"15s" desc:"Timeout for the dial the next endpoint" split_words:"true"`
48-
DialMaxDelay time.Duration `default:"5s" desc:"Upper bound on gRPC connection backoff delay" split_words:"true"`
47+
DialTimeout time.Duration `default:"750ms" desc:"Timeout for the dial the next endpoint" split_words:"true"`
4948
OpenTelemetryEndpoint string `default:"otel-collector.observability.svc.cluster.local:4317" desc:"OpenTelemetry Collector Endpoint" split_words:"true"`
5049
MetricsExportInterval time.Duration `default:"10s" desc:"interval between mertics exports" split_words:"true"`
5150
PprofEnabled bool `default:"false" desc:"is pprof enabled" split_words:"true"`

internal/imports/imports_linux.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/xconnectns/server.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
//
33
// Copyright (c) 2022-2024 Cisco and/or its affiliates.
44
//
5-
// Copyright (c) 2025 OpenInfra Foundation Europe and/or its affiliates.
6-
//
75
// SPDX-License-Identifier: Apache-2.0
86
//
97
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -69,7 +67,7 @@ func NewServer(
6967
authorizeServer: authorize.NewServer(authorize.Any()),
7068
authorizeMonitorConnectionServer: authmonitor.NewMonitorConnectionServer(authmonitor.Any()),
7169
clientURL: &url.URL{Scheme: "unix", Host: "connect.to.socket"},
72-
dialTimeout: time.Second * 15,
70+
dialTimeout: time.Millisecond * 200,
7371
domain2Device: make(map[string]string),
7472
}
7573
for _, opt := range options {

main.go

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2025 OpenInfra Foundation Europe and/or its affiliates.
1+
// Copyright (c) 2025 Nordix Foundation.
22
//
33
// Copyright (c) 2020-2025 Cisco and/or its affiliates.
44
//
@@ -40,7 +40,6 @@ import (
4040
"github.com/spiffe/go-spiffe/v2/workloadapi"
4141
"go.fd.io/govpp/api"
4242
"google.golang.org/grpc"
43-
"google.golang.org/grpc/backoff"
4443
"google.golang.org/grpc/credentials"
4544

4645
"github.com/networkservicemesh/vpphelper"
@@ -79,7 +78,6 @@ import (
7978
"github.com/networkservicemesh/cmd-forwarder-vpp/internal/xconnectns"
8079
)
8180

82-
//gocyclo:ignore
8381
func main() {
8482
// ********************************************************************************
8583
// setup context to catch signals
@@ -261,22 +259,12 @@ func main() {
261259
tlsServerConfig := tlsconfig.MTLSServerConfig(source, source, tlsconfig.AuthorizeAny())
262260
tlsServerConfig.MinVersion = tls.VersionTLS12
263261

264-
// Set faster reconnect if nsmgr or registry has been unavailable. Otherwise gRPC might
265-
// wait up to 2 minutes to attempt reconnect due to the default backoff algorithm.
266-
grpcBackoffCfg := backoff.DefaultConfig
267-
if grpcBackoffCfg.MaxDelay != cfg.DialMaxDelay {
268-
grpcBackoffCfg.MaxDelay = cfg.DialMaxDelay
269-
}
270-
271262
dialOptions := append(
272263
tracing.WithTracingDial(),
273264
grpc.WithBlock(),
274265
grpc.WithDefaultCallOptions(
275266
grpc.WaitForReady(true),
276267
grpc.PerRPCCredentials(token.NewPerRPCCredentials(spiffejwt.TokenGeneratorFunc(source, cfg.MaxTokenLifetime)))),
277-
grpc.WithConnectParams(grpc.ConnectParams{
278-
Backoff: grpcBackoffCfg,
279-
}),
280268
grpc.WithTransportCredentials(
281269
grpcfd.TransportCredentials(
282270
credentials.NewTLS(tlsClientConfig))),

0 commit comments

Comments
 (0)