Skip to content

fix(loopback): 健康检查报告真实版本并清理发现文件 - #265

Open
Jone888999 wants to merge 1 commit into
NeverENG:mainfrom
Jone888999:fix/loopback-healthz-lifecycle
Open

Jone888999 wants to merge 1 commit into
NeverENG:mainfrom
Jone888999:fix/loopback-healthz-lifecycle

Conversation

@Jone888999

Copy link
Copy Markdown
Contributor

Summary / 概述

/healthz 之前返回硬编码的 0.1.0 与恒为 false 的门控,内核退出后 runtime.json 还留在磁盘上。宿主因此会按错误版本做兼容判断,并把“忙”当“死”。

Changes / 改动

  • adapters/loopback/runtime.py:版本改读 metadata.yaml;/healthz 增加 app_version/pid/ready/started_at,runtime_gate_enabled 读生效配置。
  • adapters/loopback/server.py:正常退出删除本进程发布的 runtime.json(按端口 + 令牌核对,不误删其它实例);POSIX SIGTERM 复用 Ctrl+C 收尾。
  • 测试:healthz 生效配置、_remove_published 归属核对、POSIX 关机清理。
  • 文档与 changelog(中英各一条)。

Compatibility, data and privacy / 兼容性、数据与隐私

存储格式、schema、公开配置、端点路径均不变,无迁移。version 从 0.1.0 变为产品版本(0.7.0-rc.1),协议版本仍由 host_contract/runtime_contract 表达。

注意:runtime_gate_enabled 现在会真正生效;在共享内核上打开它,DSH 会开始按决策拒绝回复。这是修复,但需要写进 release note。

Risk and rollback / 风险与回滚

风险:宿主若依赖 version == "0.1.0" 会看到新值(仓库内无此依赖)。回滚 git revert 即可;清理只删本进程发布的内容,不涉及数据。

Checklist / 检查清单

  • I confirm the target branch is main
  • Code has passed local testing
  • I have added tests that prove my fix is effective
  • Docs are mirrored in docs/zh/ and docs/en/

验证:test_loopback_server_contract.py 7 OK(1 skipped,POSIX-only SIGTERM);test_loopback_runtime_ingress.py 9 OK。

/healthz 的版本改读 metadata.yaml,返回 app_version/pid/ready/started_at,runtime_gate_enabled 读取本次启动的生效配置;正常退出(含 POSIX SIGTERM)删除本进程发布的 runtime.json,按端口与令牌核对,不删其它实例的文件。

不改变存储格式、公开配置与端点路径;Windows 不投递 SIGTERM 处理器,发现文件保留到下次启动覆盖。GitHub issue 编号待分配。
@Jone888999
Jone888999 force-pushed the fix/loopback-healthz-lifecycle branch from affddb4 to 5e5cbd4 Compare December 3, 2026 04:01

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant