Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Stale lock takeover is undetectable by the losing holder; non-OCC writes can clobber

Closed
#334 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #423 by @Kuldeep2822k — merged

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
28/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
backend, data

Research direction

Start with updateHeartbeat in src/storage/lock.ts (lines 382-392 and 501-509), focusing on the ENOENT path that leaves lockData set and the timer running. Then check the atomicWrite call in adopt.ts line 114, which passes no fingerprint. Done means a lost lock is reported to the caller and the timer stops, and existing-file overwrites require a fingerprint. Expect to need the lock semantics in depth before changing anything.

Written by the indexing model from the issue text.

Description

bug core priority: medium

Location: src/storage/lock.ts:382-392,501-509; adopt.ts:114

When a stalled holder is reclaimed, its updateHeartbeat hits ENOENT and no-ops but does not clear lockData or stop the timer, so it still believes it holds the lock. The only backstop is OCC, but some atomicWrite calls pass no fingerprint (adopt.ts:114), so two processes can both write with no guard -> silent lost update under heartbeat starvation.

Fix: Have updateHeartbeat report loss (clear state, stop timer, surface to caller); require a fingerprint for existing-file overwrites.

From the 2026-10-10 codebase audit sweep (CODEBASE_AUDIT.md).

Dominant language
TypeScript
Stars
1
Forks
0
Avg merge
22h 21m
Merged PRs (30d)
167

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No 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.

More from Kuldeep2822k/cli

All issues in Kuldeep2822k/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.