Repository navigation
feat(jdtls): 为 JDT LS 增加国内 CNB 镜像源与双源容灾 - #55
Conversation
| "mirrors": [ | ||
| "https://cnb.cool/lithe-idea/Lithe-store/-/releases/download/managed-runtimes/jdt-language-server-1.61.0-202609031315.tar.gz" | ||
| ], |
There was a problem hiding this comment.
🔴 Missing mirror blocks JDT LS setup
With Eclipse ranked first, downloadArchive cancels a working transfer when its speed check measures below 64 KiB/s. If CNB then returns 404, the host never returns to Eclipse, so first-time JDT LS setup fails.
Learn more
When JDT LS is missing, the runtime preparation flow asks the desktop host to download it. In the pinned desktop host, rankMirrors puts unsuccessful HEAD probes last but retains them. downloadArchive visits each URL once and enables the speed cutoff whenever another URL remains, even when that URL failed its probe. With only the Eclipse URL, the speed cutoff does not apply. The configured CNB URL currently returns HTTP 404 because the release tag does not exist yet.
Example: On a clean installation with a compatible JDK, Eclipse answers HEAD and serves the JDT LS archive at a steady 48 KiB/s. CNB answers HEAD and GET with 404. The host cancels the progressing Eclipse download, tries CNB, and fails setup; without the mirror, it lets Eclipse finish.
Recommended fix: Make the host retry sources canceled only for low throughput without the speed cutoff after all other sources fail, while preserving parent cancellation and SHA-256 verification. Gate the mirror rollout on that behavior and a successful anonymous download of the pinned CNB asset.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
Thanks for catching the fallback edge case on slow primary mirrors when a secondary mirror returns 404 before mirror sync completes. Fixed in the host runtime downloader in 1lck/Lithe-IDEA#2647 (commit |
背景
Eclipse JDT Language Server (
download.eclipse.org/jdtls/milestones/...) 目前没有可用的国内公共开源镜像,国内用户首次打开 Java 文件自动下载 JDTLS 较慢或易超时。配合
Lithe-IDEA/Lithe-store#127(将jdt-language-server-1.61.0-202609031315.tar.gz经 SHA-256 校验后原样镜像至 CNBmanaged-runtimesRelease),本 PR 为jdtls的全部六个平台制品补齐国内镜像源。改动
third_party/jdtls/manifest.json:新增archiveMirrors固定 CNB 镜像地址(https://cnb.cool/lithe-idea/Lithe-store/-/releases/download/managed-runtimes/jdt-language-server-1.61.0-202609031315.tar.gz),保留上游download.eclipse.org作为官方源。io.github.lithe-idea.java-support/plugin.json:为managedRuntimes.dependencies[id="jdtls"].artifacts的 6 个平台条目(linux/macos/windows × arm64/x86_64)添加该mirrors(插件已启用managedRuntimes: 1,宿主pluginruntime会对官方源与 CNB 镜像并行HEAD测速并在失败或低于 64 KiB/s 时自动切换,同时强制校验原包 SHA-256338e7e73…34c64)。backend/tests/repository_pins.rs:校验jdtls全部平台制品的非空 HTTPSmirrors与third_party/jdtls/manifest.json的archiveMirrors一致。验证
cargo fmt --all --check:通过cargo clippy --workspace --all-targets --locked -- -D warnings:通过cargo test --workspace --locked:通过(含repository_pins11/11 与 backend/domain 全部测试)node --test --test-timeout=60000 scripts/package/*.test.mjs:通过(11/11)scripts/verify-contract.py(本地 Python 缺少jsonschema依赖),交由 CI 校验。依赖与发版顺序
Mirror to CNB工作流,确保 CNB Release 资产已就位后再基于本 PR 切新版本;即使 CNB 侧尚未同步,宿主仍会按原官方url正常回退下载。