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

fix: close file in error handling #13948

Merged
merged 1 commit into from Apr 30, 2024
Merged

Conversation

testwill
Copy link
Contributor

No description provided.

Copy link
Collaborator

@machine424 machine424 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.
I'd be great to mention that in the function doc comments for better visibility.

And I think we should get rid of the cleanup code here

if err != nil {
t.Cleanup(func() { closer.Close() })
}
as the fct should take care of that now.

Signed-off-by: guoguangwu <guoguangwug@gmail.com>
Copy link
Collaborator

@machine424 machine424 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why not close the returned Closer in TestMMapFile.

promql/query_logger_test.go Show resolved Hide resolved
Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@machine424 machine424 merged commit 9fda944 into prometheus:main Apr 30, 2024
24 checks passed
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.

None yet

5 participants