Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`TrioExecutor` acquires the capacity limiter too many times.

Aperta
#116 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
43/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start with the TrioExecutor entry point named in the issue and run the provided reproducible example to observe the blocking call. Trace how the executor and the inner trio.to_thread.run_sync call acquire capacity, then verify that the example completes with max_workers=1 without consuming the same capacity twice.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

TrioExecutor shares the limiter with the underlying trio.to_thread.run_sync call, so more tokens are consumed than are intended.

Reproducible example:

import asyncio
import trio_asyncio

async def amain():
    loop = asyncio.get_event_loop()
    executor = trio_asyncio.TrioExecutor(max_workers=1)
    await loop.run_in_executor(executor, print, "hello")

trio_asyncio.run(trio_asyncio.aio_as_trio(amain))

This call will always block, as TrioExecutor acquires the only token available and the inner trio.to_thread.run_sync cannot acquire its own token.

Lingua principale
Python
Stelle
204
Fork
42
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python-trio/trio-asyncio

Tutte le issue di python-trio/trio-asyncio

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.