`concurrent.futures.Executor.map` temporarily exceeds its `buffersize` while collecting the next result
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
Bug report
Bug description:
Potential follow up after the merge of #125663 (introduce buffersize param in Executor.map).
"Bug": concurrent.futures.Executor.map temporarily exceeds its buffersize while collecting the next result:
Let's define:
results: Iterator = executor.map(fn, iterable, buffersize=buffersize)
What happens when calling next(results):
- fetch the next
argfrominterableand put a task forfn(arg)in the buffer - wait for next result to be available
- yield the collected result
So during step 2. the buffer's size is actually buffersize + 1.
If we want a strict guarantee that there is at most buffersize concurrent tasks even during a next, we have to swap step 1. and step 2.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
- gh-131467
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Empieza en concurrent.futures.Executor.map y revisa el comportamiento descrito en torno a la recopilación del siguiente resultado. Consulta el PR vinculado gh-131467 para entender el trabajo que ya está en curso. La tarea está terminada cuando se garantiza que el búfer nunca supera temporalmente el buffersize solicitado mientras next(results) espera un resultado.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- backend
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 25/100