aicore / aicore/libmysql

Add Locking API for quickly creating custom named locks.

Open
#150 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
2
Forks
1
Avg merge
8m
Merged PRs (30d)
2

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the JavaScript MySQL client’s public API and existing resource-management entry points; the issue does not name specific files or tests. Clarify the design and acceptance criteria for named locks, configurable or infinite leases, extension, release, deadlock handling, and client-side lock maintenance before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mysql
Domain
api, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.