07th-mod / 07th-mod/python-patcher

Windows: Closing the installer loader doesn't terminate an aria2c download which is in progress

未关闭
#112 0 条评论 0 个 reaction 已指派 1 人 已被 @drojf 认领 在 GitHub 查看
bug
主要语言
JavaScript
星标
214
派生
12
PR 合并指标
30 天内没有已合并 PR

描述

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:

![image](https://user-images.githubusercontent.com/1249449/87397849-56f9e380-c5f8-11ea-9843-bed50fc7b0ad.png)

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

![image](https://user-images.githubusercontent.com/1249449/87398174-de475700-c5f8-11ea-9f90-484b156b74fe.png)

- [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.

贡献指南

这个仓库没有索引到贡献指南

调研方向

该 issue 是关于一个 Windows 特有的进程终止问题,即 aria2c 在安装程序加载器 GUI 关闭后继续运行。修复涉及通过 win32job-rs Rust 库使用 JobObject 来确保子进程被终止。首先检查生成 aria2c 的 Rust 加载器代码,然后集成 JobObject 注册。通过运行安装程序、关闭加载器并验证 aria2c 进程是否终止来进行测试。

由索引模型根据 Issue 内容生成。

评估

技术栈
python, rust
领域
cli, desktop, tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。