Skip to content

fix: close inner reader on ptr clean up #39050

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 1 commit into
base: main
Choose a base branch
from

Conversation

rogercoll
Copy link
Contributor

Description

Link to tracking issue

Fixes

Testing

Documentation

Comment on lines +45 to +47
runtime.AddCleanup(provider, func(geoReader *geoip2.Reader) {
_ = geoReader.Close()
}, provider.geoReader)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer not use leverage runtime package to correctly handle cleanup which should be done in a shutdown call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given components must have a Stop method makes sense to do the Close explicitly. I am about the change the PR, just testing out the new runtime method :)

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants