Skip to content

fix(lockfile): protege o heartbeat contra lock liberado no Windows - #44

Open
graseeel wants to merge 1 commit into
verbeux-ai:mainfrom
graseeel:fix/lockfile-heartbeat-guard
Open

fix(lockfile): protege o heartbeat contra lock liberado no Windows#44
graseeel wants to merge 1 commit into
verbeux-ai:mainfrom
graseeel:fix/lockfile-heartbeat-guard

Conversation

@graseeel

Copy link
Copy Markdown

Problema

No Windows, o callback de stat do heartbeat roda após o unlock ter removido o lock, disparando um reentry em lock undefined. Isso causa crash TypeError: Cannot read properties of undefined (reading 'updateLock') no proper-lockfile. Em permissões restritas (EACCES/EPERM), o problema se repete em loop.

Correção

  • Guarda no wrapper cobrindo stat e utimes — se o lock já foi liberado, retorna imediatamente.
  • unlock cancela o heartbeat antes de remover o lock, evitando a janela de reentry.
  • Teste que força a ordem real de unlock→heartbeat para garantir que o crash não regressa.

Nota

Reproduzido em campo no Windows com v0.15.18. Não é regressão — pré-existente na dependência proper-lockfile 4.1.2.

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