From 580b546862860ca389305d0d4614471095ec67fe Mon Sep 17 00:00:00 2001 From: Jesse Hallam Date: Wed, 3 Oct 2018 13:13:19 -0400 Subject: MM-12193: remove auto unmarshalling (#9519) * MM-12193: remove auto configuration unmarshalling Since plugin hook events are called concurrently, there's no way for the plugin framework to coordinate safe access to the automatically unmarshalled configuration fields. Remove this functionality, and update documentation to illustrate a safe way to do this. * better Fprint example * fix unit tests * log when OnConfigurationChange fails through OnActivate * clarify lifecycle when OnConfigurationChange returns an error * call SetAPI even if OnConfigurationChange not implemented --- plugin/hooks.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugin/hooks.go') diff --git a/plugin/hooks.go b/plugin/hooks.go index 4af177c0d..b5cff6f6b 100644 --- a/plugin/hooks.go +++ b/plugin/hooks.go @@ -55,7 +55,9 @@ type Hooks interface { // will stop receiving hooks just prior to this method being called. OnDeactivate() error - // OnConfigurationChange is invoked when configuration changes may have been made. + // OnConfigurationChange is invoked when configuration changes may have been made. Any + // returned error is logged, but does not stop the plugin. You must be prepared to handle + // a configuration failure gracefully. OnConfigurationChange() error // ServeHTTP allows the plugin to implement the http.Handler interface. Requests destined for -- cgit v1.2.3-1-g7c22