Skip to content

fix(lock): release the lock files that were actually taken - #79

Merged
julienj merged 1 commit into
automatephp:mainfrom
loicsapone:fix/orphan-lock-file
Aug 8, 2026
Merged

fix(lock): release the lock files that were actually taken#79
julienj merged 1 commit into
automatephp:mainfrom
loicsapone:fix/orphan-lock-file

Conversation

@loicsapone

Copy link
Copy Markdown
Contributor

initLockFile() only flagged the deployment as holding a lock after every server
had been visited:

$context->exec(function (Session $session) { ... $session->touch($lockFile); });
$this->hasLock = true;   // never reached if a later server throws

With several servers, if a later one is already locked, the exception leaves the
earlier servers with a lock file that clearLockFile() then refuses to remove. Those
servers stay locked forever: every subsequent deployment fails with "A deployment is
already in progress" until someone passes --force or deletes the file by hand.

Locks are now recorded server by server, as soon as they are taken, and released the
same way — a server locked by another deployment is left untouched.

Tests

New LockListenerTest, 3 cases. The one covering the orphan lock fails on main.

@julienj
julienj merged commit 4c3811e into automatephp:main Aug 8, 2026
5 checks passed
@loicsapone
loicsapone deleted the fix/orphan-lock-file branch August 9, 2026 05:48
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.

2 participants