View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006580||OXID eShop (all versions)||7. --- Other tools --------------||public||2017-01-30 15:15||2017-02-02 07:56|
|Product Version||4.10.1 / 5.3.1|
|Target Version||Fixed in Version|
|Summary||0006580: OnlineLicenseCheck renders shop unusable in high concurrency environment|
|Description||The license check of Oxid is implemented in a way that concurrent requests lead to COUNT() queries stacking up within the timeframe Oxid should perform the check. This can also lead to unnecessary duplicate entries of the config key "sOnlineLicenseNextCheckTime" in the oxConfig table.|
|Steps To Reproduce||COUNT() queries in oxUserCounter::getAdminCount() and oxUserCounter::getActiveAdminCount() have to be "slow", e.g. by having a high amount of rows (~1.000.000 in our case). Remove the config key "sOnlineLicenseNextCheckTime" from the oxConfig table and hit the shop with a test tool for concurrent requests. MySQL SHOW PROCESSLIST shows the COUNT() queries stacking up. If still operating on MyISAM, you will see a full table lock as expected, that basically never gets released if you have enough queries stacked up.|
|Additional Information||In high load / concurrency environments, the license check can render the shop unusable. Oxid saves the timestamp of when the license check should be triggered in the oxConfig table. Any request to the shop after that timestamp will invoke the oxSystemEventHandler to perform the license check. |
Since there is no lock mechanic and the timestamp is overridden at the end of oxSystemEventHandler::_sendShopInformation(), every request within the time the first request has fully performed the license check will invoke another check. This can happen always, even in low concurrency environments, but is a true database killer if you have enough requests going on.
An easy fix should be to move the call of oxSystemEventHandler::_updateNextCheckTime() right after oxSystemEventHandler::_needToSendShopInformation() has determined that it needs to invoke the license check.
|Tags||No tags attached.|
|PHP Version||Not defined|
|MySQL Version||Not defined|