Skip to content

MQE: ensure pooled slices not reused #11741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

charleskorn
Copy link
Contributor

What this PR does

This PR introduces a linter to catch issues like #11690.

It does this by changing LimitingBucketedPool.Put to return a nil slice, and adding a linter to enforce that this return value is used.

This isn't foolproof. For example, the linter doesn't enforce that the return value is stored in the first argument to Put (eg. b = pool.Put(a, memoryConsumptionTracker) isn't flagged).

Which issue(s) this PR fixes or relates to

#11690

Checklist

  • Tests updated.
  • [n/a] Documentation added.
  • [n/a] CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]. If changelog entry is not needed, please add the changelog-not-needed label to the PR.
  • [n/a] about-versioning.md updated with experimental features.

@charleskorn charleskorn added the changelog-not-needed PRs that don't need a CHANGELOG.md entry label Jun 16, 2025
@charleskorn charleskorn force-pushed the charleskorn/ensure-pooled-slices-not-reused branch from 82cdf96 to 83ab394 Compare June 20, 2025 01:08
@charleskorn charleskorn force-pushed the charleskorn/ensure-pooled-slices-not-reused branch from 83ab394 to 4ee2a3b Compare June 20, 2025 01:29
@charleskorn charleskorn force-pushed the charleskorn/ensure-pooled-slices-not-reused branch from 4ee2a3b to e9db1f2 Compare June 20, 2025 01:32
@charleskorn charleskorn force-pushed the charleskorn/ensure-pooled-slices-not-reused branch from 6f49f33 to e0ac2b2 Compare June 20, 2025 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-not-needed PRs that don't need a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant