fix: zero out event._args before returning events slice to sync.Pool - #24471
Merged
mergify[bot] merged 2 commits intoMay 20, 2026
Merged
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
jhx seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
fengttt
approved these changes
May 19, 2026
Torrent2002
force-pushed
the
jhx/issue-24400-eventlogger-leak
branch
from
May 20, 2026 03:22
28adffc to
3efb099
Compare
The `[:0]` reset only clears the slice length, leaving stale interface{}
pointers in the backing array's event._args slots. These retained
references prevent the GC from collecting pointed-to objects (IOVector,
byte slices, etc.), contributing to heap growth under high concurrency.
Zero both args and _args before returning the slice to eventsPool.
Ref: matrixorigin#24400
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Torrent2002
force-pushed
the
jhx/issue-24400-eventlogger-leak
branch
from
May 20, 2026 05:58
3efb099 to
e30c308
Compare
Contributor
Merge Queue Status
This pull request spent 31 seconds in the queue, including 3 seconds running CI. Required conditions to merge
|
ULookup
pushed a commit
to ULookup/matrixone
that referenced
this pull request
May 26, 2026
…atrixorigin#24471) `LogSlowEvent` resets the events slice with `[:0]` before returning it to `eventsPool`, but this only clears the length — the backing array retains stale `interface{}` pointers in `event._args[16]any` slots. These retained references prevent GC from collecting pointed-to objects (`*IOVector`, `[]byte`, etc.), contributing to heap growth under high concurrency. - Zero out `event.args` and `event._args` for every event before returning the slice to the pool - Add `TestEventLoggerPoolCleanup` to verify pooled slices are clean on reuse This fix addresses the retention side (stale pointers in pooled slices), not the allocation rate. Whether this alone resolves the OOM needs stability test verification. Approved by: @fengttt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
LogSlowEventresets the events slice with[:0]before returning it toeventsPool, but this only clears the length — the backing array retains staleinterface{}pointers inevent._args[16]anyslots. These retained references prevent GC from collecting pointed-to objects (*IOVector,[]byte, etc.), contributing to heap growth under high concurrency.event.argsandevent._argsfor every event before returning the slice to the poolTestEventLoggerPoolCleanupto verify pooled slices are clean on reuseThis fix addresses the retention side (stale pointers in pooled slices), not the allocation rate. Whether this alone resolves the OOM needs stability test verification.
Which issue(s) this PR fixes:
#24400
Test plan
go test -count=1 ./pkg/fileservice/...— all passgo test -race -run TestEventLogger— cleanPR Type