Git Product home page Git Product logo

Comments (4)

effgarces avatar effgarces commented on July 18, 2024 1

You might not even need that line, if your website does not have many users simultaneously trying to reserve resources. You can change the value as long as you keep the randomness, it's the randomness that decreases the probability of the issue happening.
Two times? Hmmm, interesting, thanks for letting us know, from my understanding of the code, it should only be called once, I need to dive further into this.

from app.

effgarces avatar effgarces commented on July 18, 2024

Hi, yes I added that one, in commit 41d71f7

The issue is that there is a racing condition in which if two or more users reserve the same resource at the exact same time then only the last one gets displays even though both succeeded in reserving the item, check here for more details:
https://forums.bookedscheduler.com/viewtopic.php?f=3&t=423

I know that this is not the ideal solution and it's only a temporary one, until I have some opening in my schedule do dedicate myself to Booked more. But seeing as we already experienced this issue I rather have this than having no fix at all. It's still possible to have a race condition but the probability is a lot lower..

from app.

bpinsard avatar bpinsard commented on July 18, 2024

Thanks for the explanation and all the work you are doing to maintain that software.
Does the duration has to be that long for the fix to work?
I noticed by profiling when updating a reservation that this gets called twice.

from app.

olivierbicler avatar olivierbicler commented on July 18, 2024

Sorry, but I don't understand the logic here.
I understand the aim of this fix is to avoid two users reserve the same resource at the exact same time T.
But the fix only move the problem : now, if user A reserve resource at time T (with a sleep(6) for instance) then the issue will happening with user B who :

  • reserve resource at time T and also get sleep(6)
  • reserve resource at time T+1 and get sleep(5)
  • reserve resource at time T+2 and get sleep(4)
  • reserve resource at time T+3 and get sleep(3)

I really don't get how probabilities are changed even with adding randomness, since reservations are also random (User can reserve anytime).

from app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.