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

Better garbage-collection on exceptions in sync_to_async #386

Merged
merged 1 commit into from
Apr 30, 2023

Conversation

tahajahangir
Copy link
Contributor

This fixes a garbage-collection issue explained in: https://stackoverflow.com/q/76118191/326792

Current implementation of sync_to_async blocks python from garbage-collecting failed tasks with reference-counting. The explicit assignment of local variable source_task to None fixes this!

@andrewgodwin
Copy link
Member

If you could fix the one linting issue, this looks good and I'd be happy to merge it!

@andrewgodwin andrewgodwin merged commit e22d765 into django:main Apr 30, 2023
6 checks passed
@andrewgodwin
Copy link
Member

Thanks!

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