Skip to content

Comments

fix: use maxlock (not maxtemp) as default in Simple::purge()#2

Closed
Koan-Bot wants to merge 3 commits intocern-mig:masterfrom
atoomic:koan.atoomic/fix-simple-purge-maxlock
Closed

fix: use maxlock (not maxtemp) as default in Simple::purge()#2
Koan-Bot wants to merge 3 commits intocern-mig:masterfrom
atoomic:koan.atoomic/fix-simple-purge-maxlock

Conversation

@Koan-Bot
Copy link

Summary

Directory::Queue::Simple::purge() was using $self->{maxtemp} as the default value for the maxlock option (line 309) instead of $self->{maxlock}. This is a copy-paste bug — compare with Normal::purge() which correctly uses $self->{maxlock}.

Impact: locked elements were cleaned up after 300 seconds (maxtemp default) instead of the intended 600 seconds (maxlock default). This could cause premature lock removal for processes holding locks between 300-600 seconds.

Changes

  • lib/Directory/Queue/Simple.pm: Fix $self->{maxtemp}$self->{maxlock} on line 309
  • t/1simple-purge.t: New test that verifies purge() uses the correct default for lock timeout

Test plan

  • New test creates a queue with maxlock=900 and maxtemp=100
  • Locks an element and backdates it to 200 seconds old
  • Verifies purge() does NOT remove the lock (200 < 900)
  • With the bug, it WOULD remove it (200 > 100)
  • Full test suite passes (241 tests)

🤖 Generated with Claude Code

Nicolas Rochelemagne and others added 3 commits July 11, 2025 17:02
Fixup pod example
… Simple.pm

Simple::purge() was using $self->{maxtemp} as the default value for the
maxlock option instead of $self->{maxlock}. This caused locked elements
to be cleaned up after 300 seconds (maxtemp default) instead of the
intended 600 seconds (maxlock default), potentially removing locks that
were still legitimately held.

Added test to verify purge() uses the correct default for each option.
@Koan-Bot
Copy link
Author

Superseded by #13 — clean branch with only the relevant fix (no fork infrastructure commits).

@Koan-Bot
Copy link
Author

Superseded by #13 (clean branch from upstream/master, no fork infrastructure noise).

@Koan-Bot Koan-Bot closed this Feb 21, 2026
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