Skip to content

fix(config): correct maxLeaseRenewalThreads validation to match error message#1703

Open
abhu85 wants to merge 1 commit intoawslabs:masterfrom
abhu85:fix/max-lease-renewal-threads-validation-207
Open

fix(config): correct maxLeaseRenewalThreads validation to match error message#1703
abhu85 wants to merge 1 commit intoawslabs:masterfrom
abhu85:fix/max-lease-renewal-threads-validation-207

Conversation

@abhu85
Copy link

@abhu85 abhu85 commented Feb 20, 2026

Summary

Fix off-by-one validation bug in withMaxLeaseRenewalThreads() method where the validation condition did not match the error message.

Problem: The validation used maxLeaseRenewalThreads > 2 but the error message stated "must be greater than or equal to 2". This caused values of exactly 2 to be rejected even though the error message indicated 2 should be valid.

Fix:

  • Changed validation from > 2 to >= 2 to match the error message
  • Updated Javadoc @throws description from "if maxLeaseRenewalThreads is <= 0" to "if maxLeaseRenewalThreads is less than 2" to accurately describe the actual behavior

Test plan

  • Code review - minimal change, logic is straightforward
  • Verified the error message already says "must be greater than or equal to 2"
  • Unit tests (no existing tests found for this specific validation)

Changes

// Before
Validate.isTrue(maxLeaseRenewalThreads > 2, "The maximum number of lease renewal threads must be greater than or equal to 2.");

// After  
Validate.isTrue(maxLeaseRenewalThreads >= 2, "The maximum number of lease renewal threads must be greater than or equal to 2.");

Fixes #207


Generated with Claude Code

… message

The validation used `maxLeaseRenewalThreads > 2` but the error message stated
"must be greater than or equal to 2". This caused values of exactly 2 to be
rejected even though the error message indicated 2 should be valid.

Changes:
- Fix validation from `> 2` to `>= 2` to match error message
- Update Javadoc @throws description to accurately describe the behavior

Fixes awslabs#207

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Abhishek Chauhan <60182103+abhu85@users.noreply.github.com>
@abhu85
Copy link
Author

abhu85 commented Mar 3, 2026

Friendly ping for review. This is a minimal 2-line fix for the off-by-one validation bug in #207 - the condition > 2 didn't match the error message "must be greater than or equal to 2".

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.

Little "maxLeaseRenewalThreads" problem

1 participant