Skip to content

"after" tasks may disappear mid-execution #775

Description

@astrand

In charge_point.py, we have:

            # after handler
            if inspect.isawaitable(response):
                asyncio.ensure_future(response)

However, according to https://docs.python.org/3.14/library/asyncio-future.html#asyncio.ensure_future:

Important Save a reference to the result of this function, to avoid a task disappearing mid-execution.

We could use the approach described at https://docs.python.org/3.14/library/asyncio-task.html#asyncio.create_task . Care should also be taken to make sure any tracebacks are printed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions