I am sending data from the host to the plugin and i'm getting a huge crash every so often - after about 4-5 'sends' of data but can be 1 or 2 sometimes.
in my service (.proto)
and I have a function that is creating a listener for each of my plugins, so that they will fire on an event meant for them.
for _, v := range a.pluginManager.Plugins {
eventName := fmt.Sprintf("plugin_frontend_event_%s", v.Info.PluginId)
runtime.EventsOn(ctx, eventName, func(optionalData ...interface{}) {
///codes,,,
byt, err := json.Marshal(optionalData)
if err != nil {
fmt.Println("error marhsalling data ", err)
return
}
var receivedDataMessages []interop.DataMessage
if err := json.Unmarshal(byt, &receivedDataMessages); err == nil {
fmt.Printf("optional data from frontend %d - %+v", len(receivedDataMessages), receivedDataMessages)
} else {
fmt.Println("error unmarshal ", err)
}
_, err = v.PluginEvent(ctx, &receivedDataMessages[0])
Where i call PluginEvent is where the crash ultimately happens. I am not sure if its possible to get debugging logs from a plugin at this point to see if anything happened in there:
(thx)
I am sending data from the host to the plugin and i'm getting a huge crash every so often - after about 4-5 'sends' of data but can be 1 or 2 sometimes.
Anything glaringly obvious?
I have
in my service (.proto) and I have a function that is creating a listener for each of my plugins, so that they will fire on an event meant for them.
Where i call
PluginEvent
is where the crash ultimately happens. I am not sure if its possible to get debugging logs from a plugin at this point to see if anything happened in there: (thx)