fix(runtime): recover orphaned gateway clients

This commit is contained in:
Xubin Ren committed 2026-08-17 20:56:10 +08:00
1 parent 92727c99a8
commit d6847b0107
3 files changed
+145 -15

No files matched your search

+7 -3
View File
@@ -433,10 +433,14 @@ class GatewayClientLease:
record = cast(dict[str, object], value)
pid = record.get("pid")
identity = record.get("identity")
if not isinstance(pid, int) or not self._process_is_running(pid):
stale.append(token)
continue
current_identity = self._process_identity(pid)
if (
not isinstance(pid, int)
or not self._process_is_running(pid)
or (identity is not None and identity != self._process_identity(pid))
identity is not None
and current_identity is not None
and identity != current_identity
):
stale.append(token)
for token in stale: