Skip to content

Free-threaded builds: an idle Events check thread keeps the last check's data for up to 60 seconds #848

Done

Description

@JuroOravec

On a free-threaded build with the GIL off, an object created on one thread and dropped by another is freed only when the thread that created it next runs Python code.

The Events check thread (Pydantic validation) builds a failed check's error, its traceback and the request data, or a successful check's result. When it then sits idle, for up to 60 s, those objects stay alive even though the caller has dropped them. That is at most one set per idle thread. It is a delay, not a leak, but large request data can stay in memory longer than expected.

Possible fixes: shorten the idle wait, or have the check thread clear its own references before it waits for the next job.

Found while fixing the 3.14t test in #844, which shortens the idle wait in the test. Related: #708.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions