Skip to content

Fix: LockManager not expiring stale locks when it should. - #192

Merged
ato merged 1 commit into
masterfrom
tweak-locks-for-index
Jul 31, 2026
Merged

Fix: LockManager not expiring stale locks when it should.#192
ato merged 1 commit into
masterfrom
tweak-locks-for-index

Conversation

@nlaforwardism

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes LockManager’s stale-lock expiry behavior by correcting the scheduling logic in the keepalive loop and aligning expiry units with the database’s UNIX_TIMESTAMP() seconds semantics.

Changes:

  • Fix stale-lock expiry scheduling so expireStaleLocks(...) is actually invoked at the configured interval.
  • Standardize lock expiry values to seconds (instead of milliseconds) to match DB time units.
  • Add targeted tests covering scheduling behavior and DB expiry unit correctness.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
ui/test/bamboo/core/LockManagerTest.java Adds tests for expiry scheduling and verifies DB expiry uses seconds; renames/cleans up the basic lock lifecycle test.
ui/src/bamboo/core/LockManagerDAO.java Renames bind parameters to expirySeconds and updates SQL bind usage for expiry-related deletes.
ui/src/bamboo/core/LockManager.java Fixes stale-lock expiry scheduling logic, introduces expireStaleLocksIfDue(...), and switches expiry to seconds with clearer interval naming.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ato
ato merged commit 37c7824 into master Jul 31, 2026
7 of 8 checks passed
@ato
ato deleted the tweak-locks-for-index branch July 31, 2026 01:25
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.

3 participants