Uploaded image for project: 'Prestashop 1.6'
  1. Prestashop 1.6
  2. PSCSX-8334

Concurrent checkouts lead to incorrect quantity in stock available

    Details

    • Type: Bug
    • Status: To Do
    • Resolution: Unresolved
    • Affects Version/s: 1.6.1.5
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      When two customers check out concurrently for the same product, only one of the checkouts is reflected in the quantity field in the stock available table.

      Steps to reproduce:
      1. Start site, create two customers, create/pick test product.
      2. Both customers add the product to their carts and perform a checkout concurrently, making sure both customers finish checkout (click the 'I confirm my order' button) as close to the same time as possible.

      We have reproduced this behavior on a single machine, by performing the above steps with one customer in one browser window and another customer in a second browser window with a short communication delay (100 ms) between the database and application. If connecting to the database using unix sockets, the following script can act as a proxy that delays packets:
      https://gist.github.com/TWarszawski/a0d8dd8aea9eb5b774d64c9f826de6db

      Expected Result:
      The final quantity is original - 2.

      Actual Result:
      The final quantity is original - 1.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                twarszawski Todd Warszawski
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: