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

Memory leak #18085

Open
4 tasks done
TheRealMal opened this issue May 28, 2024 · 2 comments · May be fixed by #18086
Open
4 tasks done

Memory leak #18085

TheRealMal opened this issue May 28, 2024 · 2 comments · May be fixed by #18086
Labels
area/performance backport/v3.5 priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. type/bug

Comments

@TheRealMal
Copy link

Bug report criteria

What happened?

file is being opened here

f, err = os.OpenFile(partpath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, fileutil.PrivateFileMode)

but being closed only here

if err = f.Close(); err != nil {

Between these lines errors can be occured and file won't be closed

What did you expect to happen?

There should close function invocation via defer

How can we reproduce it (as minimally and precisely as possible)?

Check code

Anything else we need to know?

Etcd version (please run commands below)

latest

Etcd configuration (command line flags or environment variables)

Etcd debug information (please run commands below, feel free to obfuscate the IP address or FQDN in the output)

Relevant log output

-
@TheRealMal TheRealMal linked a pull request May 28, 2024 that will close this issue
@ahrtr
Copy link
Member

ahrtr commented May 28, 2024

Thanks for raising this. Please feel free to deliver a PR, thx

@jmhbnz jmhbnz added area/performance priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. backport/v3.5 labels May 28, 2024
vivekpatani added a commit to vivekpatani/etcd that referenced this issue Jun 18, 2024
- reference: etcd-io#18085
- defer close and catch errors if unsuccessful

Signed-off-by: vivekpatani <[email protected]>
@vivekpatani
Copy link
Contributor

@ahrtr @TheRealMal #18200 - does this make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/performance backport/v3.5 priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. type/bug
Development

Successfully merging a pull request may close this issue.

4 participants