Skip to content

fix(lockfile): scope exit hooks to owned locks - #6

Open
AmanVarshney01 wants to merge 1 commit into
alchemy-run:mainfrom
AmanVarshney01:codex/lazy-lockfile-exit-hook
Open

fix(lockfile): scope exit hooks to owned locks#6
AmanVarshney01 wants to merge 1 commit into
alchemy-run:mainfrom
AmanVarshney01:codex/lazy-lockfile-exit-hook

Conversation

@AmanVarshney01

@AmanVarshney01 AmanVarshney01 commented Aug 7, 2026

Copy link
Copy Markdown

Problem

Importing @alchemy.run/node-utils/lockfile registers SIGINT and SIGTERM handlers even when no lock is owned. Alchemy imports this module transitively from alchemy/Output, so those handlers can call process.exit() before a host finishes graceful shutdown.

Fix

  • Register one cleanup hook when the first lock is acquired
  • Keep it through concurrent locks and async release
  • Remove it after the final lock is released or compromised

Testing

  • bun run build
  • bun test (77 passed)

Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
@AmanVarshney01
AmanVarshney01 force-pushed the codex/lazy-lockfile-exit-hook branch from 2c34d36 to e734490 Compare August 7, 2026 11:59
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