Files
mostlymatter/plugin
Agniva De Sarker ea98f9f4a9 MM-44045: Fix double plugin creation due to recursive plugin activation (#20165)
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
```
2022-05-12 10:57:23 +05:30
..
2022-02-28 15:01:00 +05:30
2021-01-07 22:42:43 +05:30
2021-08-17 16:08:04 -04:00