Skip to content
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

pin: fix a bunch of fd leaks in tests #1651

Merged
merged 1 commit into from
Jan 24, 2025
Merged

pin: fix a bunch of fd leaks in tests #1651

merged 1 commit into from
Jan 24, 2025

Conversation

lmb
Copy link
Collaborator

@lmb lmb commented Jan 21, 2025

The new pin package didn't import fdtrace.TestMain until now, which is why the leaks went by unnoticed.

The new pin package didn't import fdtrace.TestMain until now, which
is why the leaks went by unnoticed.

Signed-off-by: Lorenz Bauer <[email protected]>
@lmb
Copy link
Collaborator Author

lmb commented Jan 21, 2025

It's very easy to accidentally leak objects when using WalkDir, and kind of awkward to do the right thing (because obj can be nil?) This is why https://pkg.go.dev/github.com/cilium/ebpf/btf#HandleIterator.Take exists for handles. It might be good to do another pass over this API.

cc @ti-mo @mtardy @dylandreimerink @rgo3

@github-actions github-actions bot added the breaking-change Changes exported API label Jan 21, 2025
@mtardy
Copy link
Member

mtardy commented Jan 21, 2025

Mmmh I'm slightly confused now, this it the typical use we have in Tetragon:

Maybe having an example in the doc would make thing more clear?

@lmb lmb marked this pull request as ready for review January 21, 2025 16:50
@lmb lmb requested a review from a team as a code owner January 21, 2025 16:50
@lmb
Copy link
Collaborator Author

lmb commented Jan 21, 2025

Timo pointed out that an issue is probably a better place for this: #1652

@ti-mo
Copy link
Collaborator

ti-mo commented Jan 24, 2025

I knew I forgot something. Thanks for the patch! Let's continue the conversation in the issue.

@ti-mo ti-mo merged commit a0e13c4 into cilium:main Jan 24, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Changes exported API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants