Jelajahi Sumber

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 tahun lalu
induk
melakukan
2e03fbcf76
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  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