07th-mod / 07th-mod/python-patcher
Windows: Closing the installer loader doesn't terminate an aria2c download which is in progress
- Linguagem predominante
- JavaScript
- Estrelas
- 214
- Forks
- 12
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
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.
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
O problema é sobre um problema específico do Windows na terminação de processos, onde o aria2c continua após o fechamento da GUI do carregador do instalador. A correção envolve o uso de um JobObject por meio da biblioteca Rust win32job-rs para garantir que os processos filhos sejam encerrados. Comece examinando o código do carregador Rust que inicia o aria2c, depois integre o registro do JobObject. Teste executando o instalador, fechando o carregador e verificando se os processos aria2c terminam.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python, rust
- Domínio
- cli, desktop, tooling
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100