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>
这个提交包含在:
父节点
4bf0fefc67
当前提交
336ce72c7a
@ -801,6 +801,17 @@ public class SystemUpdateService {
|
|||||||
"up", "-d", "--no-deps", "--force-recreate", svc);
|
"up", "-d", "--no-deps", "--force-recreate", svc);
|
||||||
// 拿到 compose up 之后最新创建的容器 ID,排除旧容器干扰
|
// 拿到 compose up 之后最新创建的容器 ID,排除旧容器干扰
|
||||||
String newContainerId = getNewestContainerId(svc);
|
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);
|
boolean healthy = waitForServiceStable(emit, svc, newContainerId, HEALTH_CHECK_TIMEOUT_SEC);
|
||||||
if (healthy) {
|
if (healthy) {
|
||||||
@ -943,6 +954,7 @@ public class SystemUpdateService {
|
|||||||
).redirectErrorStream(true).start();
|
).redirectErrorStream(true).start();
|
||||||
statusLine = new String(ins.getInputStream().readAllBytes(), StandardCharsets.UTF_8).trim();
|
statusLine = new String(ins.getInputStream().readAllBytes(), StandardCharsets.UTF_8).trim();
|
||||||
ins.waitFor();
|
ins.waitFor();
|
||||||
|
emit.accept(" [debug] " + service + " t=" + elapsed + "s inspect " + containerId + " → " + statusLine);
|
||||||
} else {
|
} else {
|
||||||
// 退化模式:查 running 容器
|
// 退化模式:查 running 容器
|
||||||
Process runPs = new ProcessBuilder(
|
Process runPs = new ProcessBuilder(
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户