python / python/cpython

Keep Track of Where Each Python Thread Was Started

Aberta
#125,928 4 comentários 2 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

stdlib type-feature
Linguagem predominante
Python
Estrelas
77.2k
Forks
36k
Métricas de merge de PRs
Métricas de PR pendentes

Descrição

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 https://github.com/python/cpython/pull/124640.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Comece lendo o ponto de entrada Thread.start() e traceback.TracebackSummary para entender os limites propostos de captura e armazenamento. Defina o design com os mantenedores de threading e, em seguida, adicione cobertura mostrando que uma thread registra onde foi iniciada sem reter frames de traceback ativos.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python
Domínio
operating-systems
Tipo de issue
Funcionalidade
Dificuldade
5/5
Tempo estimado
Mais de uma semana
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.