-
Notifications
You must be signed in to change notification settings - Fork 0
Fix too-many-open-files leak in availability worker and version lookup #21
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -209,4 +209,4 @@ def build_paginated_response( | |
|
|
||
| def get_version(repo_root: Path) -> Optional[str]: | ||
| """Gets the repository version for a given repo_root.""" | ||
| return filesystem.get_version(repo_root) | ||
| return filesystem.get_release_and_timestamp(repo_root).get("version") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure exactly what this change does? In the old path, it calls git_versioning.get_version(), which creates a new Repo() object on each call and in the new path, it's calling get_release_and_timestamp, which also creates a new Repo on each call, but has a @cached decorator, so I guess it should reuse that cached object. is that the only difference?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it seems like nothing else calls git_versioning.get_version() after this, so we can probably just remove that method too.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it looks like the other methods (list_versions, get_version_info) also use the same cache, but could be distinct per site/node, and fill the cache up? we might want to use a different cache for the get_release_and_timestamp because it depends only on the repo_path.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good points.
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good fix, I think there's a longstanding footgun where openstack "connection" objects aren't garbage collected.