Hi all,

Sending this out to warn plugin authors about some changes that have just landed on Heka's dev branch that might potentially break your plugin.

I've recently been paying down some technical debt in the code base, in particular running all of our tests w/ the race detector on and making sure that no race conditions are found. One of the biggest pain points was the way we were handling Heka's global config options, which were made available to Heka and any plugins through a package global `Globals() *GlobalConfigStruct` function.

Globals are almost always a bad idea, and the way we were overriding that function was leading to race conditions that we couldn't avoid, so we've instead decided to hang the GlobalConfigStruct object off of the PipelineConfig object. This means that if you have any code that was previously using `pipeline.Globals()`, you'll need to instead get a handle to the PipelineConfig and replace the function call with a `pConfig.Globals` attribute access.

In most cases you can get the PipelineConfig from the PluginHelper that is passed in to a plugin's Run() method. If you need access to these values in ConfigStruct or Init (i.e. before the Run method has been invoked), however, you can implement a `SetPipelineConfig(pConfig *pipeline.PipelineConfig)` method and Heka will call that before calling any other methods on your plugin.

Hopefully this is clear. If this impacts you and you can't make sense of my description, though, please feel free to send an email or drop by our IRC channel and we'll be happy to help you adjust your code.

Thanks!

-r
_______________________________________________
Heka mailing list
[email protected]
https://mail.mozilla.org/listinfo/heka

Reply via email to