07th-mod / 07th-mod/python-patcher
Windows: Closing the installer loader doesn't terminate an aria2c download which is in progress
- Lingua principale
- JavaScript
- Stelle
- 214
- Fork
- 12
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
As per the title, if you close the installer loader (which should terminate the whole installer), it doesn't terminate the aria2c download. This is pretty bad, as it could result in both the download continuing when you don't expect it to, and also multiple aria2c downloads occurring simultaneously.
when running normally:

After closing the installer loader ("07th-mod Installer Launcher [v1.1.47]"):

- [x] make sure when the installer loader GUI is terminated ("07th-mod Installer Launcher [v1.1.47]") the whole proccess is terminated
- [ ] double check the same doesn't happen with 7-zip extraction
- [ ] double check that on other platforms, when the python script is run by itself without a loader, this can't happen (on windows, this seems to work if you run the installer just from the python script)
- [ ] Add actual button to stop the download/extraction on the web UI
----
Edit: It looks like this issue has to do with the process being run with a (hidden) console. If you run the process with a console, it's not fully terminated until the console is killed. But we hide the console so as not to confuse users. This seems to make windows keep aria2c alive, as it sees the console window is still there.
----
Edit2: after trying out some things, I'm going to try this: https://stackoverflow.com/questions/23434842/python-how-to-kill-child-processes-when-parent-dies/23587108 . It's windows (or linux) specific, but at this stage I just want it to work.
----
Edit3: Registering a JobObject at the rust loader using this handy library: https://github.com/ohadravid/win32job-rs seems to fix the issue, but I'll just make sure everything is in order before I release a fix.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Il problema riguarda un problema specifico di Windows nella terminazione dei processi, in cui aria2c continua dopo la chiusura della GUI del loader dell'installer. La soluzione prevede l'uso di un JobObject tramite la libreria Rust win32job-rs per assicurare che i processi figli vengano terminati. Inizia esaminando il codice del loader Rust che genera aria2c, quindi integra la registrazione del JobObject. Testa eseguendo l'installer, chiudendo il loader e verificando che i processi aria2c terminino.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python, rust
- Ambito
- cli, desktop, tooling
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100