debug: add verbose logging to health check to diagnose tenant-web false positive

Logs container ID, all visible containers for each service, and inspect status
at each check interval. Will be removed after root cause is identified.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
这个提交包含在:
XuqmGroup 2026-06-13 02:09:49 +08:00
父节点 4bf0fefc67
当前提交 336ce72c7a

查看文件

@ -801,6 +801,17 @@ public class SystemUpdateService {
"up", "-d", "--no-deps", "--force-recreate", svc);
// 拿到 compose up 之后最新创建的容器 ID排除旧容器干扰
String newContainerId = getNewestContainerId(svc);
emit.accept(" [debug] " + svc + " newContainerId=" + newContainerId);
// Log all containers visible for this service label
try {
Process dbgPs = new ProcessBuilder("docker", "ps", "-a",
"--filter", "label=com.docker.compose.service=" + svc,
"--format", "{{.ID}} {{.Names}} {{.Status}} {{.CreatedAt}}")
.redirectErrorStream(true).start();
String dbgOut = new String(dbgPs.getInputStream().readAllBytes(), StandardCharsets.UTF_8).trim();
dbgPs.waitFor();
for (String l : dbgOut.split("\n")) { if (!l.isBlank()) emit.accept(" [debug] " + l); }
} catch (Exception ignored) {}
boolean healthy = waitForServiceStable(emit, svc, newContainerId, HEALTH_CHECK_TIMEOUT_SEC);
if (healthy) {
@ -943,6 +954,7 @@ public class SystemUpdateService {
).redirectErrorStream(true).start();
statusLine = new String(ins.getInputStream().readAllBytes(), StandardCharsets.UTF_8).trim();
ins.waitFor();
emit.accept(" [debug] " + service + " t=" + elapsed + "s inspect " + containerId + "" + statusLine);
} else {
// 退化模式 running 容器
Process runPs = new ProcessBuilder(