Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug][macOS] 打开已有运行配置的项目时同步探测 JDK/Maven 阻塞主线程

Closed
#1,098 2 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@defia is already working on this.

Since Oct 7, 2026.

Assessment

This issue has not been assessed yet.

Description

area:run bug claimed P1 platform:macos review: high
Platform / 平台

macOS

Area / 模块

Run / 运行

Lithe version / Lithe 版本

0.5.15(52);独立诊断在 preview 06dff03db3582798fcf9ab38bb8edacc31270ea8 上进行,不包含本轮项目树导航或搜索菜单修改。

Priority / 优先级

P1:选择项目进入 IDE 后短时间无法操作界面,随后恢复。

OS and architecture / 操作系统与架构

macOS 27.0.1,Apple Silicon / arm64。本机存在多个 JDK 安装。

Environment / 环境信息

原始 Java 项目约 213 MiB、385 个受版本控制文件,已有保存的运行配置。
最小复现不需要源文件、pom.xml 或 Git 仓库,仅需一个有效的 .lithe/run/generated.json;因此项目大小不是这条阻塞路径的必要条件。

Steps to reproduce / 复现步骤
  1. 创建空目录,在 .lithe/run/generated.json 写入以下有效示例配置(仓库 single-module fixture 的 generated 部分):
{"version":1,"configurations":[{"id":"spring:com.example.App","name":"App","type":"spring-boot.maven","module":".","mainClass":"com.example.App","toolchains":{"java":"project-jdk","maven":"project-maven"},"workingDirectory":".","jvmArguments":[],"programArguments":[],"mavenProfiles":[]}]}
  1. 在有多个 JDK 的 macOS 上打开该项目。
  2. 在恢复运行配置、自动识别工具链期间操作界面;或通过真实 AppModel 打开流程在后台每 10ms 向主队列提交回调,测量 5 秒窗口内的最大等待时间。
  3. 对照:仅移除 generated.json,打开同一空目录;不卸载或修改本机 JDK/Maven。
Expected behavior / 预期行为

工具链探测在后台进行,并保留取消、超时及工作区过期结果检查。界面持续响应;工具链选择及最终运行配置结果不因性能修复改变。

Actual behavior / 实际行为

恢复保存的运行配置时串行阻塞主线程,导致界面在该阶段无法响应。

Logs or diagnostic output / 日志或诊断输出

实测(独立偏好设置、真实生产 AppModel/服务容器;没有创建项目树视图):

场景 主队列最大等待
原始项目,preview 基线首次测量 2330ms
最小项目,只有保存的运行配置 946ms
最小项目,增加线程/耗时诊断日志 1914ms
同一最小项目,仅移除运行配置 20ms
原始项目再次测量 1385ms

最小项目的定向诊断日志:22 次 java -version、1 次 java_home -V、1 次 mvn -version,24 次均为 Thread.isMainThread == true。进程探测累计 1899ms,对应同次主队列等待 1914ms。移除配置后主线程探测次数为 0。

主线程 sample 调用链与源码对应:
WorkspaceSessionCoordinator.startWorkspaceRebuild → AppModel.loadProjectServices → ProjectDevelopmentFeatureModel.loadProject → RunFeatureModel.loadProject → RunService.loadProject → resolveWithServiceToolchains → toolchainCandidates → ProjectRuntimeService.runConfigurationToolchainCandidates → MacRuntimeDiscovery.commandOutput → MacProcessRunner.run → Thread.sleep。

RunService 和 RunRuntimePort 都在 MainActor(主线程执行器)上。虽然外层 loadProject 是 async,内部工具链候选解析仍调用同步接口;MacProcessRunner 在调用线程循环等待子进程结束。JDK 自动发现逐个启动版本探测进程,配置解析还会探测选中 JDK/Maven,累积形成可观察停顿。

源码定位:

以上确认了一条启动主线程阻塞路径;尚未声称覆盖所有项目打开/渲染卡顿。诊断期间未修改工具链选择规则,也未提交性能修复代码。

Screenshots or recordings / 截图或录屏

暂无录屏;已用主队列延迟、最小配置对照和主线程采样复现。公开报告只保留脱敏命令名及汇总数据,未上传私人项目配置、源码或完整环境。

Checklist / 提交前检查
  • 已检索 412 个开放及历史 issue,并额外检索主线程、JDK/Maven 探测、运行配置相关描述。
  • 已移除敏感信息和私人项目路径。
相似 issue 核对
  • #521 是 Git 状态失败导致卡顿;本最小复现没有 Git 仓库。
  • #338 是大文件树渲染;本复现没有树视图,只有一个运行配置文件。
  • #814 是工具链生效值展示,明确要求表单探测异步;本问题位于打开项目恢复运行配置的另一条调用链。
  • #815 是 JDK 版本选择正确性,修复本问题应保留其选择规则。
  • #591 是 JDTLS/Maven 项目导入超时,最小复现没有 Java 源文件,也不依赖 JDTLS 导入。
Dominant language
TypeScript
Stars
1.8k
Forks
151
Avg merge
7h 51m
Merged PRs (30d)
351

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from 1lck/Lithe-IDEA

All issues in 1lck/Lithe-IDEA

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.