A local run never closes its LocalCluster, so in-process main() runs leave dask workers alive
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- backend, distributed-systems, testing
Línea de trabajo
Empieza en pybnf/cluster.py, en Cluster.__init__ y Cluster.teardown; sigue la creación de clústeres locales y la ruta de fallo al iniciar el clúster local. Lee tests/lwf_harness.run_main y las pruebas que ejecutan llamadas a main() en el mismo proceso. El trabajo estará terminado cuando el teardown libere los workers locales tanto en las rutas normales como en las de error; confirma que las ejecuciones repetidas no dejan ningún worker activo y que el comportamiento de ssh, srun y scheduler_file no se ve afectado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Cluster.__init__ in pybnf/cluster.py builds the local cluster as
lc = LocalCluster(**lc_kwargs)
self.client = Client(lc)
and keeps no reference to lc. Cluster.teardown() only calls self.client.close(). In distributed, Client.close() closes a cluster only when the client created that cluster itself (Client() with no address). A cluster object handed to Client(...) is left running. So the LocalCluster and its worker processes stay alive until the Python process exits.
A command-line run exits right after teardown, so users don't see this. Every in-process pybnf.main() run does see it. That includes tests/lwf_harness.run_main and the tests that use it: each such run leaves its workers alive for the rest of the pytest process. A review of another branch counted 320 live dask worker children in one pytest process, which slows the suite down.
Reproduced on main at 292774b0 with distributed 2026.7.1. Two in-process main() runs with parallel_count = 2 each started a LocalCluster with two spawned workers. After each run returned, its LocalCluster still reported Status.running and both of its workers were still alive. The runs' error path leaks the same way, because main()'s finally tears down only the client.
Fix: keep the LocalCluster on the Cluster and close it in teardown, after the client. Also close it if local bring-up fails after the cluster starts. The ssh, srun and scheduler_file paths are unaffected, because PyBNF does not own a LocalCluster there.
- Lenguaje dominante
- Python
- Estrellas
- 26
- Forks
- 25
- Merge medio
- 4 h 9 min
- PR fusionados (30 d)
- 11
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la 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.
Más de lanl/PyBNF
-
bug minor
Dificultad 1/5 1-3 horas Aptitud para principiantes 92/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
lanl/PyBNF#1049 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug tech debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
bug minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
Todos los issues de lanl/PyBNF
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
nael5x/creative-ai#130 ·
-
Make the "%" unit spacing the same in the web and in A10Posiblemente ocupada @kragent66-glitch la tomó hoy. Abiertobug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 comentario ·
-
ci severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
TMHSDigital/Spackle#205 ·
Los mantenedores suelen responder en 1 día
-
pkg:lgm type:chore upstream-gaussx
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
jejjohnson/pyrox#610 ·
Los mantenedores suelen responder en 1 día