-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A plugin might be installed several times concurrently #9211
Comments
Also whenever we install a plugin we should check whether config is actually writable before we start installing. Just mentioning in case we don't do it yet. |
I quickly tried to implement it via config.ini.php but it's not trivial. Eg if the script that installs the plugin times out the plugin would be still marked as currently installing and no new attempt in installing the plugin again would be made. We'd kinda have to use something like |
From the looks this might be actually only a problem if the plugin exists in Normal workflow via UI or console command for 3rd party plugins, when activating a plugin, is to install it first and then add it to |
I just had a look at the plugin install code in PluginManager: https://github.com/piwik/piwik/blob/2.15.1-b1/core/Plugin/Manager.php#L1068-L1071
What happens is that we detect a loaded plugin and check if it's installed or not. If it is not installed yet, we install it and add it to the list of installed plugins afterwards.
The problem is that there might be several other requests during a plugin installation and they will all try to install the plugin concurrently as we only add the
PluginInstalled
flag after installation (which is correct). This can lead to errors like this where a plugin is not installed correctly: #8683We need something like a new flat
PluginInstallationInProgress[]=PluginName
and if there is already one installation in progress we should not start the installation process again.The longer a plugin installation takes, the higher the chance that the installation will end up with errors. In case of the new plugin CustomDimensions #9129 whose installation may take several hours we would not only add 5 custom dimensions but
Number of Request to Piwik during that time frame * 5 custom dimensions
. I have not tested it but I'm sure this is what would possibly happen.The text was updated successfully, but these errors were encountered: