Skip to content

Risk of websocket ping tasks being garbage collected before they finish #8614

Closed
@bdraco

Description

@bdraco
          These are at risk of being garbage collected before they finish. 

This is an existing problem to be solved in a future PR
https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task

Important 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. For reliable “fire-and-forget” background tasks, gather them in a collection:

Originally posted by @bdraco in #8608 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions