From 4e60cd0fb845ffefa9590084bb5261a113ad6858 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Wed, 14 Aug 2024 12:52:49 +0300 Subject: [PATCH 1/2] adaptation: close plugin if initial synchronization fails. Signed-off-by: Krisztian Litkey --- pkg/adaptation/adaptation.go | 4 ++-- pkg/adaptation/plugin.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/adaptation/adaptation.go b/pkg/adaptation/adaptation.go index 82dddd63..d87126d3 100644 --- a/pkg/adaptation/adaptation.go +++ b/pkg/adaptation/adaptation.go @@ -449,9 +449,9 @@ func (r *Adaptation) acceptPluginConnections(l net.Listener) error { r.plugins = append(r.plugins, p) r.sortPlugins() r.Unlock() - } - log.Infof(ctx, "plugin %q connected", p.name()) + log.Infof(ctx, "plugin %q connected", p.name()) + } } }() diff --git a/pkg/adaptation/plugin.go b/pkg/adaptation/plugin.go index 7a445b41..2b5ea2da 100644 --- a/pkg/adaptation/plugin.go +++ b/pkg/adaptation/plugin.go @@ -418,6 +418,7 @@ func (p *plugin) synchronize(ctx context.Context, pods []*PodSandbox, containers } rpl, err := p.stub.Synchronize(ctx, req) if err != nil { + p.close() return nil, err } From 4aec208281ac3630b02d737005778527aec8abae Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Thu, 22 Aug 2024 17:17:34 +0300 Subject: [PATCH 2/2] adaptation: log plugin as connected and synchronized. Co-authored-by: Mike Brown Signed-off-by: Krisztian Litkey --- pkg/adaptation/adaptation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/adaptation/adaptation.go b/pkg/adaptation/adaptation.go index d87126d3..8022804b 100644 --- a/pkg/adaptation/adaptation.go +++ b/pkg/adaptation/adaptation.go @@ -450,7 +450,7 @@ func (r *Adaptation) acceptPluginConnections(l net.Listener) error { r.sortPlugins() r.Unlock() - log.Infof(ctx, "plugin %q connected", p.name()) + log.Infof(ctx, "plugin %q connected and synchronized", p.name()) } } }()