From 61c6c50344776b0f46f7186d4f2f564e1b727a0e Mon Sep 17 00:00:00 2001 From: Jiyong Huang Date: Fri, 25 Nov 2022 11:41:18 +0800 Subject: [PATCH] fix(rule): rule hang while restarting if the plugin was deleted previously Signed-off-by: Jiyong Huang --- internal/topo/rule/ruleState.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/topo/rule/ruleState.go b/internal/topo/rule/ruleState.go index 47fef1db1c..e1733fdbb4 100644 --- a/internal/topo/rule/ruleState.go +++ b/internal/topo/rule/ruleState.go @@ -66,11 +66,11 @@ func NewRuleState(rule *api.Rule) (*RuleState, error) { Rule: rule, ActionCh: make(chan ActionSignal), } + rs.Run() if tp, err := planner.Plan(rule); err != nil { return rs, err } else { rs.Topology = tp - rs.Run() return rs, nil } } @@ -203,7 +203,6 @@ func (rs *RuleState) runTopo(ctx context.Context) { if rs.Topology != nil { rs.topoGraph = rs.Topology.GetTopo() } - rs.Topology = nil rs.Unlock() } }