• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LFDT-Panurus / panurus / 31072719354
85%

Build:
DEFAULT BRANCH: main
Ran 06 Aug 2026 05:14AM UTC
Jobs 0
Files 0
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
31072719354

push

github

AkramBitar
feat(sherdlock): coordinate token-lock cleanup leadership across replicas

Implements #1798: currently every replica runs the token-locks cleanup
tick independently, causing wasted, overlapping work (all replicas race
to delete the same expired rows). This adds a leadership check per tick
so only one replica performs cleanup, following the same pattern already
used for keystore cleanup (AcquireCleanupLeadership).

Changes
-> Added AcquireCleanupLeadership to both driver.TokenLockStore and
   sherdlock.Locker interfaces
-> Added a shared driver.NoopCleanupLeadership for non-distributed
   backends (sqlite, in-memory), which always grant leadership locally
-> Wired the real Postgres advisory-lock implementation via the existing
   NewCleanupLeaderFactory()
-> manager.go's cleaner() now acquires leadership before each Cleanup
   tick; skips the tick if not acquired; releases leadership after
-> Lock ids are derived per-TMS from the fully-qualified table name
   (tableNames.TokenLocks) rather than from a global constant or the
   table prefix: sherdlock.Manager is instantiated per TMS, and a
   prefix is shared by every TMS in one persistence block, so both
   would have let a single TMS starve the others' cleanup. The same
   derivation is applied to the pre-existing schema-creation lockID,
   which had the identical collision bug, and the two ids are kept
   distinct from each other. The leader factory is constructed once at
   store construction rather than rebuilt per call.
-> Regenerated the FakeLocker mock; added AcquireCleanupLeadership to the
   hand-written mockLocker test double, defaulting to always-granted so
   all existing tests are unaffected

Tests
-> TestManager_Cleaner: added skip-on-no-leadership and
   leadership-released-after-cleanup subtests (the latter verifies
   Cleanup actually ran to completion before Close, not merely that
   Close was called), both with m.Stop() so tick goroutines do not
   outlive the subtest, and with a non... (continued)
Source Files on build 31072719354
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #31072719354
  • 3705a1c6 on github
  • Prev Build on main (#31050564571)
  • Next Build on main (#31075662332)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc