Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Auto-isolate asyncio tasks if event loop is running

Aberta
#5,379 3 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

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

Direção de pesquisa

Comece lendo a AsyncioIntegration existente e seu comportamento de isolamento de escopo; em seguida, compare os designs propostos de ativação automática. Verifique como um event loop em execução é instrumentado, se é possível aplicar o patch repetidamente e como os usuários existentes de AsyncioIntegration seriam afetados. O trabalho estará concluído quando o isolamento de tarefas funcionar automaticamente, enquanto os recursos adicionais continuarem explicitamente opt-in e os casos sem event loop falharem de forma controlada.

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

Descrição

Better Async Support Improvement Integration: Asyncio Python

Currently, the opt-in AsyncioIntegration is responsible for multiple things, one of them being providing proper scope isolation in asyncio tasks. Without this functionality, people are running into different types of hard-to-diagnose scope bleed issues, like here.

Goal
  • Automatically patch the current event loop to isolate tasks in their isolation scopes, if there is an event loop running
  • For additional functionality (creating task spans, etc.), explicit opt-in should still be required from users
How to do this

Different ways to do this, each with its own caveats (e.g. introducing breaking changes).

  1. Take the isolation scope logic out of AsyncioIntegration into its own integration and make it auto-enabled (best effort, if there is no event loop we can't do anything).
  2. Make AsyncioIntegration auto-enabled, and change the additional functions it's providing (like task spans) to be opt-in. Also, make it fail gracefully if there is no event loop to patch.
  3. ???

When picking an option, consider:

  • Will this break behavior for existing users using the AsyncioIntegration?
  • Is there a risk of double-patching the event loop?
Linguagem predominante
Python
Estrelas
2.2k
Forks
672
Merge médio
22h 47min
PRs com merge (30d)
224

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.

Mais de getsentry/sentry-python

Todas as issues de getsentry/sentry-python

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

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