浏览代码

fix(portable): fix restart rule with multiple portable symbol reference

The instance may be initialized twice as the command list cannot guarentee to be updated before next symbol starting

Signed-off-by: Jiyong Huang <huangjy@emqx.io>
Jiyong Huang 2 年之前
父节点
当前提交
2e03fbcf76
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      internal/plugin/portable/runtime/plugin_ins_manager.go

+ 1 - 1
internal/plugin/portable/runtime/plugin_ins_manager.go

@@ -207,7 +207,7 @@ func (p *pluginInsManager) getOrStartProcess(pluginMeta *PluginMeta, pconf *Port
 		p.instances[pluginMeta.Name] = ins
 	}
 	// ins process has not run yet
-	if !pluginCreation && len(ins.commands) != 0 {
+	if !pluginCreation && ins.ctrlChan != nil {
 		return ins, nil
 	}
 	// should only happen for first start, then the ctrl channel will keep running