The (*Environment).Activate method only guarded against multiple calls and therefore wasn't properly re-entrant. If a plugin calls an UpdateConfiguration in the OnActivate hook, it would again call this method, resulting in 2 plugin processes getting created. To prevent that from happening, we pre-emptively set the status to running just after the supervisor is created. I am not sure why starting the plugin normally from the server does not cause this because the root cause is the same and there should be 2 plugin processes created in the normal scenario as well. I have not spent time looking into that. But let me know if you want me to. Unit test: This might be a bit hard to test via a unit test. I think an e2e test maybe written in the playbooks test itself which counts the number of processes that the server spawns. https://mattermost.atlassian.net/browse/MM-44045 ```release-note NONE ```
16 KiB
16 KiB