Repository navigation
优化启动器崩溃处理机制 - #6825
优化启动器崩溃处理机制#6825CiiLu wants to merge 9 commits into
Conversation
CiiLu
commented
Sep 6, 2026
- 移除目前的崩溃分析机制。目前大部分规则已经过期,且正确率极低。且目前如果分析出了原因只会显示仅有原因的 Alert。在崩溃群或用户群遇到这种还得引导用户使用命令行启动 hmcl 或手动寻找日志文件,交流成本极高。
- 在崩溃窗口添加导出启动器日志按钮
- 多次出现错误时在现有窗口追加内容,避免部分频繁处理的逻辑(如加载游戏版本)出错一次性出现一大堆崩溃窗口。
| /** | ||
| * @author huangyuhui | ||
| */ | ||
| public class CrashWindow extends Stage { |
There was a problem hiding this comment.
[ERROR] [com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck]
Class CrashWindow should be declared as final.
| } | ||
|
|
||
|
|
||
| public void addCrashReport(CrashReport report) { |
There was a problem hiding this comment.
[ERROR] [com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck]
'METHOD_DEF' has more than 1 empty lines before.
|
|
||
|
|
||
|
|
||
| public static Path exportLogsAsZip() throws IOException { |
There was a problem hiding this comment.
[ERROR] [com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck]
'METHOD_DEF' has more than 1 empty lines before.
| } | ||
|
|
||
|
|
||
| private static String getEntryName(Set<String> entryNames, String name) { |
There was a problem hiding this comment.
[ERROR] [com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck]
'METHOD_DEF' has more than 1 empty lines before.
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6a36d69dc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| btnExport.setOnAction(event -> { | ||
| exportPane.getChildren().setAll(progressIndicator); | ||
| try { | ||
| Path path = LauncherLogExporter.exportLogsAsZip(); |
There was a problem hiding this comment.
Run the log export off the JavaFX application thread
When retained logs are large, compressed, or stored on a slow filesystem, this call scans, decompresses, and recompresses up to five files and waits for Logger.exportLogs directly inside the button's JavaFX action handler. The FX pulse therefore cannot render the progress indicator, the crash window remains unresponsive, and subsequent queued crash reports cannot appear until the export finishes. Dispatch the export to Schedulers.io() and return to the JavaFX executor for the dialog and button update, as the settings-page export already does.
Useful? React with 👍 / 👎.
# Conflicts: # HMCL/src/main/java/org/jackhuang/hmcl/ui/CrashWindow.java # HMCL/src/main/resources/assets/lang/I18N.properties # HMCL/src/main/resources/assets/lang/I18N_ar.properties # HMCL/src/main/resources/assets/lang/I18N_de.properties # HMCL/src/main/resources/assets/lang/I18N_es.properties # HMCL/src/main/resources/assets/lang/I18N_ja.properties # HMCL/src/main/resources/assets/lang/I18N_lzh.properties # HMCL/src/main/resources/assets/lang/I18N_ru.properties # HMCL/src/main/resources/assets/lang/I18N_zh_Hans.properties # HMCL/src/main/resources/assets/lang/I18N_zh_Hant.properties
|
来自崩溃报错群 在主线中仍然存在着的崩溃分析器已造成误导 我们需要此PR |
|
@codex review |
|
为什么该PR无法抓到 使用任务管理器强行结束游戏进程 的崩溃事件? 这是预期行为吗? |
Glavo
left a comment
There was a problem hiding this comment.
本审查建议由 GPT-6 Astra 生成
已将具体审查建议标注在对应代码行。
|
|
||
| SettingsManager.shutdown(); | ||
| LOG.shutdown(); | ||
| } |
There was a problem hiding this comment.
[P2] 保留启动失败路径的资源清理
删除关闭逻辑后,如果 Launcher.main() 在 JavaFX 初始化前失败,Platform.runLater() 会抛出 Toolkit not initialized,而 Launcher.stop() 也不会执行。非守护日志线程因此一直存活,留下没有窗口、无法自行退出的进程。已通过独立进程复现;补上日志关闭后正常退出。应为无法显示崩溃窗口的启动失败路径保留清理逻辑。
| btnExport.setOnAction(event -> { | ||
| exportPane.getChildren().setAll(progressIndicator); | ||
| try { | ||
| Path path = LauncherLogExporter.exportLogsAsZip(); |
There was a problem hiding this comment.
[P2] 将日志导出移至后台线程
按钮回调在 JavaFX UI 线程扫描、解压并重新压缩最多五份历史日志,还会等待 Logger.exportLogs()。日志较大或磁盘较慢时,整个界面冻结,进度指示器无法刷新,后续崩溃报告也无法显示。应沿用设置页的 Schedulers.io() 异步导出方式,再回 UI 线程更新窗口。已有审查指出此问题,当前提交仍未修复。
Upstream HMCL HMCL-dev#6194 HMCL-dev#6860 HMCL-dev#6947 HMCL-dev#6747 HMCL-dev#6806 HMCL-dev#6407 HMCL-dev#6869 HMCL-dev#6825. Adapt JFXPopup and mod update logic to preserve existing fork features; retain crash diagnostics. Java CI and Check Codes passed; JAR/EXE/SH/DEB and nonempty credentials verified.
|
怎么关闭了? |
|
为什么关了 |
估计是太久没动静了 |