View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006599||OXID eShop (all versions)||4.02. Session handling||public||2017-03-07 20:07||2017-03-17 17:53|
|Target Version||Fixed in Version|
|Summary||0006599: race condition in order finalization when session locking is disabled|
|Description||When using OXID eShop in an environment where session locking is disabled, you can experience race conditions (<= 5.3) or deadlocks (>= 6.0) when order finalization takes place and "[..]somebody klicked like mad on order button". Besides the madness, it is likely to happen when MySQL has hiccups and responds slowly while  is executed and the user clicks again to make sure the order is submitted.|
When running into this problem, the following cases occur:
OXID eShop <= 5.3
The oxorder tuple gets saved twice (with the same OXID taken from sess_challenge and two order confirmation mails) but reserves two order numbers via the oxcounter mechanism thus resulting in one skipped order number. Yet even more important is, that the basket content is saved twice in oxorderarticles with the same referencing oxorder.oxid.
OXID eShop >= 6.0
Although data consistency is ensured through transactions (no skipped order number, no redundant oxorderarticles tuples) it results in a deadlock exception and the user sees a blank page.
Non-locking sessions can be a huge performance benefit for example when using AJAX. Besides that, not all session storages have locking implemented. To name one: The Redis php extension doesn't have this feature  but is suggested by you .
A good overview of possible php session storages and their locking behaviour can be found here .
|Steps To Reproduce||- Make sure your setup has session locking disabled |
- add a sleep(10); before the save call in  to "simulate" bad MySQL responsiveness or just to buy you more time in the last checkout step
- add one article to your basket
- go through the checkout steps and click twice at "Order now" in the last checkout step
|Tags||No tags attached.|
|Browser||Firefox, Internet Explorer, Google Chrome|