Skip to content

Entity locking (critical sections) #148

Description

@ahmedmuhsin

Part of #141

Goal

Let an orchestrator acquire locks on one or more entities for the duration of a critical section, so it can read then write across entities without interleaving.

Scope

  • Add a lock entities method on the orchestration context that acquires an ordered lock set and returns a handle that releases the locks when closed.
  • Track critical section state on the orchestration, block disallowed transitions while locks are held, and release on exit.
  • Backend support for the lock protocol, ordered acquisition and release messages, and orphaned lock detection.

Reference

durabletask-dotnet TaskOrchestrationEntityFeature.LockEntitiesAsync, which returns a disposable handle, InCriticalSection, and the EntityLockRequestedEvent in the protos. The lock set is acquired in a fixed order to avoid deadlock.

Depends on

Call and signal from an orchestration, and the backend lock machinery from the foundational entity runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions