fix(verification): API 重试、Runner JDK 17 与 JVM user.home 固定 - #135
Open
pwd11 wants to merge 3 commits into
Open
Conversation
受限网络下 api.github.com 大响应(如 open pull requests 列表)会被间歇性 截断,抛 http.client.IncompleteRead,导致 gate/adopt 在竞争工作检测处随机 失败。GET 请求幂等,改为最多 5 次尝试、平方退避;POST/PATCH 非幂等,保持 不重试。重试成功时清除 last_error 避免误报。
容器以 host uid 运行且镜像内无对应 passwd 条目时,部分 JDK 将 user.home 解析为 "?",Maven/JGit 等把缓存写到工作区内随沙箱销毁,bootstrap 联网 下载的依赖在断网 verify 阶段全部失效。注入 JAVA_TOOL_OPTIONS 将 user.home 固定到 /reposteward-env/home 持久卷,覆盖所有 Java 进程(含测试 fork)。
- 通过 apt 安装 openjdk-17-jdk-headless 并链接为 /opt/java/temurin-17, 支持需要 Java 17 的仓库(如 Spring Boot 3);默认 JDK 仍为 8,不影响 既有仓库 - Maven 发行版改用 TUNA 镜像(SHA512 校验保持不变) - 所有 curl 增加 --retry 5 --retry-all-errors,避免受限网络下大文件下载 中断导致整层构建失败
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue
Closes #134
问题与改动
受限网络环境(github.com:443 间歇断流、api.github.com 大响应被截断)下实测暴露验证链路三个可靠性问题,三个聚焦提交分别修复:
GitHubClient._request单次请求,约 750KB 的 open pull requests 列表间歇性IncompleteRead,gate/adopt 随机失败。改为 GET 最多 5 次尝试、平方退避(1/4/9/16s);POST/PATCH 非幂等不重试。重试成功后清除last_error避免误报。JAVA_TOOL_OPTIONS=-Duser.home=/reposteward-env/home(持久卷),覆盖所有 Java 进程。/opt/java/temurin-17(默认 JDK 8 不变);Maven 发行版改 TUNA 镜像(SHA512 校验不变);所有 curl 加--retry 5 --retry-all-errors。验证
端到端证据(本机受限网络实测):使用新镜像对 spring-ai-alibaba/DataAgent 完成两次 adopt 全流程,bootstrap 联网下载 + 断网 verify(1712/1715 个 Java 测试、spotless、checkstyle)全部通过;此前相同流程因 user.home="?" 与 API 截断反复失败。新增回归测试:
test_get_request_retries_transient_transport_errors、test_post_request_does_not_retry_transient_transport_errors、test_container_receives_shared_cache_and_read_only_git_mounts中补充 JAVA_TOOL_OPTIONS 断言。风险与兼容性
JAVA_TOOL_OPTIONS会打印 "Picked up JAVA_TOOL_OPTIONS" 到 stderr(无害);对非 Java 仓库无影响/opt/java/current链接未变,既有仓库行为不变;镜像体积增加约 300MB自动化辅助
使用 Claude Code 实现与验证;人工复核了完整 diff、三个提交边界、测试结果与镜像构建日志。
Checklist