Repository navigation
[stable35] fix(lock): stop overwriting a lock's creation time with the real clock - #1288
Merged
Merged
Conversation
LockService::lock() called setCreation(time()) right after building the FileLock, overwriting the creation timestamp that FileLock's own constructor had already set correctly via the injected ITimeFactory. The extra call is redundant under normal operation, but it bypasses whatever clock a test has mocked in. That's what made testRemoveDeprecatedLocks flake in CI on MySQL and Oracle: the test freezes the mocked clock and later advances it by 1801 seconds (one second past its 30-minute cutoff), but the lock's actual creation time came from the real, unmocked clock a few milliseconds later. Whenever wall-clock execution crossed a one-second boundary between those two moments, creation ended up equal to the cutoff instead of one second before it, and the strict "<" comparison in getLocksOlderThan() excluded the lock from the deprecated set. Reproduced locally by looping the lock/check cycle against real PHP 8.5 + MySQL 8.4 until it failed, and confirmed creation and cutoff landed on the exact same second each time. Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> # Conflicts: # tests/Feature/LockFeatureTest.php
backportbot
Bot
requested review from
benjaminfrueh and
juliusknorr
as code owners
September 8, 2026 17:10
backportbot
Bot
requested review from
solracsf
and removed request for
juliusknorr
September 8, 2026 17:10
benjaminfrueh
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of PR #1284