Skip to content

fix(cli): surface swallowed errors in locks module#247

Open
0xAxiom wants to merge 1 commit intomainfrom
fix/locks-silent-error-swallowing
Open

fix(cli): surface swallowed errors in locks module#247
0xAxiom wants to merge 1 commit intomainfrom
fix/locks-silent-error-swallowing

Conversation

@0xAxiom
Copy link
Copy Markdown
Owner

@0xAxiom 0xAxiom commented May 1, 2026

What

CLI/src/core/locks.ts had three silent catch {} blocks where errors were swallowed with no log output:

  1. acquireLock — corrupt lock unlink failure: The outer catch logged "Removing corrupted lock file" but if the subsequent fs.unlinkSync also failed, the inner catch {} was completely silent. A lock that can't be removed stays in place and blocks future runs with no explanation.

  2. releaseLock — all errors: The entire try block was wrapped in catch { // Ignore errors during cleanup }. If the lock file is corrupted at release time, the lock is never removed and the next run will either block or have to force-release it — with no log entry to explain why.

  3. getLockInfo — read/parse errors: catch { // Ignore } made a corrupted lock file return null, indistinguishable from "no lock exists". Callers can't tell the difference.

Fix

Replace each catch {} / catch { // Ignore } with catch (err) { logger.warn(...) } so the error surfaces in the run log. No functional change when things work correctly.

Why

Silent failures in the locking layer lead to ghost locks and hard-to-diagnose "pipeline won't start" situations. With a warn log, a developer or the user can see what actually went wrong.

🤖 Generated with Claude Code

Replace silent `catch {}` blocks with logged warnings so that:
- A corrupted lock file and any unlink failure both emit a warning
  (previously both were silently ignored after a generic log)
- `releaseLock()` failure no longer silently leaves a stale lock
  with no trace in the log
- `getLockInfo()` parse/read errors are logged rather than collapsed
  into an indistinguishable null return

No functional behaviour change when things go right; broken-lock
scenarios now produce a warning rather than disappearing silently.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@0xAxiom 0xAxiom requested a review from MeltedMindz as a code owner May 1, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant