A local run never closes its LocalCluster, so in-process main() runs leave dask workers alive
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- backend, distributed-systems, testing
Direzione di ricerca
Inizia in pybnf/cluster.py, in corrispondenza di Cluster.__init__ e Cluster.teardown; segui la creazione dei cluster locali e il percorso di errore durante l’avvio locale. Leggi tests/lwf_harness.run_main e i test che eseguono chiamate a main() nello stesso processo. Il lavoro è terminato quando il teardown rilascia i worker locali nei percorsi normali e in quelli di errore; conferma che le esecuzioni ripetute non lasciano worker attivi e che il comportamento di ssh, srun e scheduler_file rimane invariato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 26
- Fork
- 25
- Merge medio
- 4h 9m
- PR unite (30g)
- 11
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lanl/PyBNF
-
bug minor
Difficoltà 1/5 1-3 ore Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
lanl/PyBNF#1049 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
nael5x/creative-ai#130 ·
-
Make the "%" unit spacing the same in the web and in A10Forse già presa @kragent66-glitch l’ha presa oggi. Apertabug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 commento ·
-
ci severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
TMHSDigital/Spackle#205 ·
I maintainer di solito rispondono entro 1 giorno
-
pkg:lgm type:chore upstream-gaussx
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
jejjohnson/pyrox#610 ·
I maintainer di solito rispondono entro 1 giorno