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

DM-43739: Fix memory leak in HTTPResourcePath #84

Merged
merged 1 commit into from Apr 8, 2024
Merged

Conversation

dhirving
Copy link
Contributor

@dhirving dhirving commented Apr 8, 2024

Fixed an issue where query parameters or fragments in an HTTP URL would cause it to be considered as having a different root URI. This caused a new HTTP session to be created and cached each time an HTTP URL with a different query parameter was accessed.

This resulted in a memory leak in datalinker when it was using HTTPResourcePath to access S3 presigned URLs, which always have unique query parameters.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

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

Thanks for finding this problem.

@@ -417,7 +417,7 @@ def root_uri(self) -> ResourcePath:
uri : `ResourcePath`
Root URI.
"""
return self.replace(path="", forceDirectory=True)
return self.replace(path="", query="", fragment="", forceDirectory=True)
Copy link
Member

Choose a reason for hiding this comment

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

params as well?

Fixed an issue where query parameters or fragments in an HTTP URL would cause it to be considered as having a different root URI.  This caused a new HTTP session to be created and cached each time an HTTP URL with a different query parameter was accessed.

This resulted in a memory leak in datalinker when it was using HTTPResourcePath to access S3 presigned URLs, which always have unique query parameters.
@dhirving dhirving merged commit 3290f87 into main Apr 8, 2024
14 checks passed
@dhirving dhirving deleted the tickets/DM-43739 branch April 8, 2024 21:25
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

2 participants