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 摘要。