Skip to content

Add Locking API for quickly creating custom named locks. #150

@abose

Description

@abose

There should be a way to enter a named critical section with coco SQL client. Something similar to this API or an easier way to do this:

let lock = await db.lock("database.customLockName", leaseTimeoutMS);
// do my critical section things
await lock.extend(leaseTimeoutMS); // taking longer time than expected, increase lock lease time
// do my critical section things
await lock.release();
  • leaseTimeoutMS should be application controlled as it depends on program correctness requirements and can be infinite.
  • If deadlock arises, it will be an application task to recover.
  • DB resources will not be spent to maintain locks. The locking compute will be fully maintained at the client lib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions