Skip to content

Keep Track of Where Each Python Thread Was StartedΒ #125928

@ericsnowcurrently

Description

@ericsnowcurrently

Feature or enhancement

Proposal:

Debugging threads can be tricky. One thing that could sometimes help would be knowing where Thread.start() was called. We could achieve this by capturing the traceback of the call and attaching it to the thread. We probably wouldn't want to keep the actual traceback, due to how that would leak all the frames, etc. Instead, we'd probably want to use traceback.TracebackSummary or perhaps even something more lightweight. (FYI, there are other places where such a lightweight traceback snapshot would be useful.)

FWIW, the same sort of tracking might be helpful for coroutines (asyncio), though this is partly addressed by #124640.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions