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

Set cache=False option on all FilterHook instances used on object methods #1815

Open
rafalp opened this issue Sep 15, 2024 · 0 comments
Open
Labels
area: backend This issue involves Python, Django or dependency (eg. database) feature: extensions Extension points for 3rd party plugins and customizations help wanted

Comments

@rafalp
Copy link
Owner

rafalp commented Sep 15, 2024

FilterHook instance called with object's method as action will save this instance in its cache, producing a memory leak and breaking hooks next calls if used object is not singleton.

Example:

class MyClass:
    def do_something(self):
        hook(self.do_something_action)

    def do_something_action(self):
        ...

If MyClass is not singleton, first instance's do_something_action method instance will be cached on hook instance and used in all future calls.

@rafalp rafalp added help wanted area: backend This issue involves Python, Django or dependency (eg. database) feature: extensions Extension points for 3rd party plugins and customizations labels Sep 15, 2024
@rafalp rafalp added this to the Next feature release milestone Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: backend This issue involves Python, Django or dependency (eg. database) feature: extensions Extension points for 3rd party plugins and customizations help wanted
Projects
None yet
Development

No branches or pull requests

1 participant