Add Locking API for quickly creating custom named locks.
Open
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();
leaseTimeoutMSshould 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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