Skip to content

fix(pool): saturate ObjectStatus::recycle_count on increment - #495

Open
biaoma-ty wants to merge 1 commit into
apache:mainfrom
biaoma-ty:fix/pool-recycle-count-saturating
Open

biaoma-ty wants to merge 1 commit into
apache:mainfrom
biaoma-ty:fix/pool-recycle-count-saturating

Conversation

@biaoma-ty

Copy link
Copy Markdown
Contributor

Summary

  • Change ObjectStatus::mark_recycled to use saturating_add(1) instead of unchecked += 1, preventing overflow panics (which would drop a checked-out object without updating current_size or running on_detached) or wraparound to 0 on long-lived hot objects.
  • Document saturating behavior on ObjectStatus::recycle_count and add a unit test at usize::MAX.
  • Record the fix in CHANGELOG.md.

This branch has not been deployed

No deployments
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