Skip to content

Commit

Permalink
set nri always reconnect
Browse files Browse the repository at this point in the history
Signed-off-by: Zhang Kang <kang.zhang@intel.com>
  • Loading branch information
kangclzjc committed Apr 29, 2024
1 parent b46a168 commit 094d565
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions pkg/koordlet/runtimehooks/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package runtimehooks

import (
"flag"
"math"
"time"

"k8s.io/apimachinery/pkg/util/runtime"
Expand Down Expand Up @@ -134,8 +135,8 @@ func NewDefaultConfig() *Config {
RuntimeHooksNRI: true,
RuntimeHooksNRIConnectTimeout: 2 * time.Second,
RuntimeHooksNRIBackOffDuration: 1 * time.Second,
RuntimeHooksNRIBackOffCap: 10 * time.Minute,
RuntimeHooksNRIBackOffSteps: 100,
RuntimeHooksNRIBackOffCap: 1<<62 - 1,
RuntimeHooksNRIBackOffSteps: math.MaxInt32,
RuntimeHooksNRIBackOffFactor: 2,
RuntimeHooksNRISocketPath: "nri/nri.sock",
RuntimeHookReconcileInterval: 10 * time.Second,
Expand Down
5 changes: 3 additions & 2 deletions pkg/koordlet/runtimehooks/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package runtimehooks

import (
"flag"
"math"
"testing"
"time"

Expand All @@ -38,8 +39,8 @@ func Test_NewDefaultConfig(t *testing.T) {
RuntimeHooksNRI: true,
RuntimeHooksNRIConnectTimeout: 2 * time.Second,
RuntimeHooksNRIBackOffDuration: 1 * time.Second,
RuntimeHooksNRIBackOffCap: 10 * time.Minute,
RuntimeHooksNRIBackOffSteps: 100,
RuntimeHooksNRIBackOffCap: 1<<62 - 1,
RuntimeHooksNRIBackOffSteps: math.MaxInt32,
RuntimeHooksNRIBackOffFactor: 2,
RuntimeHooksNRISocketPath: "nri/nri.sock",
RuntimeHookReconcileInterval: 10 * time.Second,
Expand Down
1 change: 1 addition & 0 deletions pkg/koordlet/runtimehooks/nri/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ func (p *NriServer) onClose() {
}
}

// TODO: high version wait not support BackoffUntil with BackOffManger as parameters, when updated to v0.27.0 version wait, we can refine ExponentialBackoff.
err := wait.ExponentialBackoff(p.options.BackOff, retryFunc)
if err != nil {
klog.Errorf("nri server restart failed after several times retry")
Expand Down

0 comments on commit 094d565

Please sign in to comment.