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

save a reference to created tasks, to avoid tasks disappearing #17946

Merged
merged 2 commits into from
Jul 3, 2023

Conversation

anio
Copy link
Contributor

@anio anio commented Jun 28, 2023

This change saves references for created tasks to avoid tasks disappearing.

Save a reference to the result of this function, to avoid a task disappearing mid-execution. The event loop only keeps weak references to tasks. A task that isn’t referenced elsewhere may get garbage collected at any time, even before it’s done.

python docs

Please review the link: https://textual.textualize.io/blog/2023/02/11/the-heisenbug-lurking-in-your-async-code/

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

Reviewer checklist
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

@github-actions github-actions bot added app Generic label for Lightning App package and removed app Generic label for Lightning App package labels Jun 28, 2023
@anio
Copy link
Contributor Author

anio commented Jun 28, 2023

@pre-commit-ci removed the change as task variable that I added was not used in the rest of the code 😆

@awaelchli awaelchli added bug Something isn't working community This PR is from the community app Generic label for Lightning App package labels Jun 29, 2023
@awaelchli awaelchli added this to the 2.0.x milestone Jun 29, 2023
@github-actions github-actions bot removed the app Generic label for Lightning App package label Jun 29, 2023
@github-actions github-actions bot added the app Generic label for Lightning App package label Jun 29, 2023
Copy link
Collaborator

@lantiga lantiga left a comment

Choose a reason for hiding this comment

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

Thank you @anio, sneaky one

@mergify mergify bot added the ready PRs ready to be merged label Jul 2, 2023
@awaelchli awaelchli enabled auto-merge (squash) July 3, 2023 11:15
@awaelchli awaelchli merged commit 658e1ab into Lightning-AI:master Jul 3, 2023
74 of 86 checks passed
Borda pushed a commit that referenced this pull request Jul 7, 2023
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
(cherry picked from commit 658e1ab)
Borda pushed a commit that referenced this pull request Jul 7, 2023
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
(cherry picked from commit 658e1ab)
Borda pushed a commit that referenced this pull request Jul 7, 2023
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
(cherry picked from commit 658e1ab)
Borda pushed a commit that referenced this pull request Jul 7, 2023
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
(cherry picked from commit 658e1ab)
lantiga pushed a commit that referenced this pull request Jul 10, 2023
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
(cherry picked from commit 658e1ab)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Generic label for Lightning App package bug Something isn't working community This PR is from the community ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants