Git Product home page Git Product logo

Comments (4)

nmaludy avatar nmaludy commented on May 25, 2024 1

List of locks could potentially be dangerous and cause deadlock scenarios, in my opinion.

Classic deadlock scenario is:

# Thread A

Lock X
Lock Y

Unlock Y
Unlock X


# Thread B
Lock X
Lock Y

Unlock X
Unlock Y

If locks are not obtained and released in the exact same order in all code paths, you risk the chance of a deadlock scenario. It's much safer to just have one single lock and ensure it is always released in the face of an exception or return from your code path (In this case a workflow success or failure).

from orquesta.

nzlosh avatar nzlosh commented on May 25, 2024

Small question, would it make sense to support a list of locks rather than a single lock? Could people want to acquire locks on different resources with different timeouts but still want the executing workflow to depend one or both of them?

from orquesta.

nzlosh avatar nzlosh commented on May 25, 2024

Fair enough, I was coming from a specific use case where I needed a lock for a group of servers and another lock for individual server within that group when I asked if it made sense to support a list of locks.

If Orquesta would suffer from the same deadlock/livelock issues as OS threads, then I agree it's a dangerous feature to allow.

from orquesta.

m4dcoder avatar m4dcoder commented on May 25, 2024

This is a good point on deadlock. I think for the time being we will keep this simple. The engine should detect that a lock is already acquired and will not allow additional lock requests in subworkflow(s) since that is possible.

from orquesta.

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.