Skip to content

add_callback() isn't safe against reentrancy #1874

@pitrou

Description

@pitrou

add_callback() can occasionally being called in a reentrant way, if a destructor triggers some non-trivial resource cleanup code.
You can find an occurrence here:
leporo/tornado-redis#59
and another here:
dask/distributed#599 (comment)

It seems a possible fix would be to temporarily disable the gc before taking the callback lock.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions