Skip to content

Reland #111979 with a cross-platform server liveness check - #112906

Closed
alexey-milovidov wants to merge 16 commits into
masterfrom
reland-111979-cross-platform-liveness
Closed

alexey-milovidov wants to merge 16 commits into
masterfrom
reland-111979-cross-platform-liveness

Conversation

@alexey-milovidov

Copy link
Copy Markdown
Member

Related: #111979
Related: #112812
Related: https://github.com/ClickHouse/clickhouse-private/issues/66906

Relands #111979, which was reverted by #112812.

#111979 made stop_server signal the server itself rather than the sh -c wrapper above it, so a wedged server gets SIGTRAP/SIGKILL and releases its lock on <run_path>/status before the system.*_log scraping runs. It identified the server by reading argv[0] from /proc/<pid>/cmdline.

macOS has no /proc, so on the Fast test (arm_darwin) runners that read always raised and _server_process_alive always answered "already gone". The server was never signalled and was left orphaned on every run, holding the write end of praktika's TeePopen stdout pipe; TeePopen.wait never saw EOF, so praktika run hung after an otherwise-green run. Those runners are --ephemeral, so each hung job consumed a Mac host permanently and the pool drained from 10 usable to 2 in about four hours.

What is different this time

  • Process identity is read through /proc where it exists and through ps where it does not. The Linux path is byte for byte what it was.
  • ps runs with -ww, so it does not truncate the command line to the terminal width - that truncation was the reason /proc was preferred in the first place, and there is a test for it.
  • When neither source can answer, an existing pid is reported alive rather than gone. This direction is deliberate: a server wrongly believed gone is never stopped, which is what burns a runner, whereas signalling a recycled pid requires that pid to be both freed and handed out again inside the teardown window. Happy to flip this if reviewers prefer the opposite trade-off.
  • _parent_pid (the watchdog walk) got the same treatment.
  • ClickHouseProc.HAS_PROC is probed once at import rather than branching on platform.system(), so the Darwin path is reachable from tests running on Linux CI.

Testing

The regression test from #111979 is restored and extended from 6 to 13 cases; the 7 new ones set HAS_PROC = False to drive the macOS path on Linux CI, including the incident end to end (test_stop_server_stops_the_server_without_proc).

Verified locally that they catch the original defect: with _process_argv0 reverted to the /proc-only behaviour, 4 of the 7 fail, and the captured output reproduces the exact pair of lines every wedged host logged:

ClickHouse process 3353288 is already gone - TRAP not sent
Wrapper process 3353284 is still alive - send KILL signal

All 13 pass with the fix (python3 -m pytest ci/tests/test_stop_server_signals_server_not_wrapper.py).

Follow-up not included here

Contributing factor 4 of the postmortem - TeePopen.wait() blocking forever on a pipe whose write end a grandchild inherited - is untouched. Correct teardown avoids it, but any future process leak reintroduces the same wedge, so hardening TeePopen is worth a separate PR.

Changelog category (leave one):

  • CI Fix or Improvement

#111979 made `stop_server` signal the server itself rather than the `sh -c`
wrapper above it, so that a wedged server gets `SIGTRAP`/`SIGKILL` and releases
its lock on `<run_path>/status` before the `system.*_log` scraping runs.

It identified the server by reading `argv[0]` from `/proc/<pid>/cmdline`. macOS
has no `/proc`, so on the `Fast test (arm_darwin)` runners the read always
raised and `_server_process_alive` always answered "already gone": the server
was never signalled and was left orphaned on every run, holding the write end of
praktika's `TeePopen` stdout pipe. `TeePopen.wait` never saw EOF, so
`praktika run` hung after an otherwise-green run, and since those runners are
`--ephemeral` each hung job consumed a Mac host for good - the pool drained from
10 usable to 2 in about four hours and #111979 was reverted by #112812.

Process identity is now read through `/proc` where it exists and through `ps`
where it does not, keeping the Linux path byte for byte what it was. `ps` runs
with `-ww` so it does not truncate the command line to the terminal width, which
was the reason `/proc` was preferred in the first place. When neither source can
answer, an existing pid is reported alive rather than gone: a server wrongly
believed gone is never stopped, which is what burns a runner, while signalling a
recycled pid needs that pid to be both freed and handed out again inside the
teardown window.

`ClickHouseProc.HAS_PROC` is probed once at import instead of branching on
`platform.system()`, so the Darwin path is reachable from tests on Linux CI. The
restored regression test adds seven cases that drive it, including the incident
end to end; all four that depend on the fix fail against the original code with
the same `already gone - TRAP not sent` line the wedged hosts logged.

Caused by: #111979
Related: #112812
@clickhouse-gh

clickhouse-gh Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [d93c027]

Summary: ✅


AI Review

Summary

This PR relands the stop_server server-liveness fix, adds a ps fallback for hosts without /proc, and then hardens the watchdog restart-gap handling with a substantial regression harness. The restart-gap fixes themselves look consistent on the current head, but the new "if the identity source cannot answer, fail closed" contract is only implemented on the ps path, so I cannot approve the current revision as-is.

Missing context / blind spots
  • ⚠️ I could not rerun ci/tests/test_stop_server_signals_server_not_wrapper.py in this checkout because python3 -m pytest fails with /usr/bin/python3: No module named pytest.
Findings
  • ⚠️ Major: [ci/jobs/scripts/clickhouse_proc.py:1276] The PR body explicitly says that when the process-identity source cannot answer, an existing pid is treated as alive, and that _parent_pid got the same treatment. That is true on the ps path, but not on the /proc path: _process_argv0 still maps any /proc/<pid>/cmdline OSError to "no such process", and _parent_pid still maps any /proc/<pid>/status error to 0. A transient /proc read failure on a live Linux server or watchdog therefore reopens the same failure mode this PR is fixing: stop_server can skip signalling a live server, or record a definitive empty watchdog snapshot and trust an empty pid file inside the restart gap. The Linux path needs the same ProcessIdentityUnknown distinction that the ps path now has.
Final Verdict

⚠️ Changes requested.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 1, 2026
Comment thread ci/jobs/scripts/clickhouse_proc.py Resolved
alexey-milovidov and others added 3 commits August 2, 2026 19:50
… lives

`_stop_respawned_server` read the pid file once and returned as soon as it
named no live server. That is not proof that nothing is coming back: in
`CLICKHOUSE_WATCHDOG_RESTART=1` mode the replacement server publishes its pid
only once it is up, and `start` itself budgets 15 seconds for that - well past
the wait for the `sh -c` wrapper above. A respawn slower than the teardown
therefore came up after `stop_server` returned and held `<run_path>/status`
while `clickhouse local` scraped `system.*_log`, which is the failure this
teardown exists to prevent.

`_stop_one_server` now snapshots the watchdogs above the server before
signalling anything - once the server is gone they can no longer be found by
walking up from the pid file - and `_stop_respawned_server` treats an empty pid
file as final only when every one of them has exited. While one is alive the
decision is deferred for `RESPAWN_GRACE_TIMEOUT`, and a watchdog that outlives
even that is killed, because from that point nothing else would stop it from
publishing another server.

`_stop_server_watchdogs` becomes `_kill_watchdogs`, taking the pids to kill
rather than deriving them from a server pid, since the grace-period path has no
server pid to walk up from.

The regression test drives the exact race: a `delayed` fake watchdog that
publishes its replacement server 5 seconds after the first one dies, with the
`sh -c` wrapper already reaped. Before this commit `stop_server` returned in
1.3 seconds with the watchdog still alive and free to bring a server back.
`BaseDaemon::setupWatchdog` renames the watchdog by writing
`clickhouse-watchdog` over its `argv[0]` in place - truncated to the
length of the original name, so a server started as `clickhouse-server`
leaves it named `clickhouse-watchd` - and restores the original name
just before each respawn fork. The watchdog handling in `stop_server`
filtered every candidate through the `clickhouse-server`-only identity
check, so in `CLICKHOUSE_WATCHDOG_RESTART=1` mode `_server_watchdog_pids`
returned nothing, the grace-period wait in `_stop_respawned_server` had
no watchdog to wait for, and an empty pid file could still be taken as
final while the real, renamed watchdog was free to publish a replacement
server holding `<run_path>/status`.

`_watchdog_process_alive` now accepts any truncation of
`clickhouse-watchdog` no shorter than `clickhouse-watch`, plus the
server's own name for the moments around the rename, and is used for
watchdog discovery, the settling wait, and the kill path (`_signal_server`
and `_wait_server_gone` take the identity check as a parameter).

The fake server in the tests now models the rename with `execv` through
differently named symlinks - same pid, new `argv[0]`, like the in-place
`memcpy` - so the respawn tests exercise the real `clickhouse-watchd`
shape; three focused discovery tests cover the truncated, untruncated,
and not-yet-renamed watchdog names. The renamed-watchdog discovery test
and both respawn tests fail on the previous code.

#112906

Co-Authored-By: Claude Fable 5 <[email protected]>
Comment thread ci/jobs/scripts/clickhouse_proc.py Resolved
alexey-milovidov and others added 2 commits August 4, 2026 17:09
When `stop_server` begins after one server exited but before the
watchdog's replacement rewrote the pid file, both the pid file and the
startup pid name a dead process, so the walk in `_stop_one_server`
snapshotted no watchdogs and `_stop_respawned_server` took the empty
pid file as final - while the still-live watchdog was free to publish a
replacement server holding `<run_path>/status` moments later.

Snapshot the watchdog chain in `start`, while the pid just read from
the pid file is known to name a live server, and fall back to that
snapshot at teardown when the walk from the current pid finds nothing.
The watchdog keeps its own pid across the respawns it performs, so the
startup snapshot still names the process that can bring a server back.

Add the reviewer's reproducer as a regression test: kill the first
`restart_mode="delayed"` fake server before calling `stop_server`
and assert the watchdog does not outlive the teardown and no server
comes back. It fails before this fix and passes after; 18/18 pass.

Co-Authored-By: Claude Fable 5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 The sole red check, Stress test (arm_tsan), failed with Logical error: ColumnBLOB should be converted to a regular column before usage — unrelated to this PR, which only touches ci/jobs/scripts/clickhouse_proc.py and its tests. It is tracked in #113165, and the fix is in progress in #111997.

Comment thread ci/jobs/scripts/clickhouse_proc.py Resolved
Comment thread ci/jobs/scripts/clickhouse_proc.py Resolved
Two gaps in how `ProcessIdentityUnknown` was handled in watchdog
discovery on hosts without `/proc`:

- `_parent_pid` let it escape from `_ps_field`, so a transient `ps`
  failure made `start` report success without recording `self.pid_*`
  (the later `stop_server` skipped the replica), or aborted
  `_stop_one_server` before any signal was sent. It now reads as
  "parent unknown" (0), degrading to the startup snapshot /
  no-watchdog path.

- `_watchdog_process_alive` inherited the fail-close "unknown means
  alive" of the server liveness check, which is wrong for ancestor
  discovery: with `ps -o command=` failing while `ps -o ppid=` works,
  `_server_watchdog_pids` promoted the `sh -c` wrapper and every live
  ancestor into SIGKILL targets for `_kill_watchdogs`. Discovery now
  passes `unknown_alive=False`, ending the walk at the first ancestor
  it cannot identify, while the signal/wait paths keep the fail-close
  default for pids already established as watchdogs.

Both reproductions from the review are added as tests; they fail
before the fix and pass after.
Comment thread ci/jobs/scripts/clickhouse_proc.py Resolved
…respawned_server` when the fresh walk fails

On the `HAS_PROC = False` path a transient `ps` failure makes
`_server_watchdog_pids` return no ancestors, so the came-back-server branch
of `_stop_respawned_server` killed only the current server while the watchdog
stayed alive and respawned another one; after `RESPAWN_STOP_ATTEMPTS` the
teardown returned with a live server still holding `<run_path>/status`. The
branch now falls back to the `watchdogs` snapshot taken before the teardown,
the same fallback `_stop_one_server` already uses; `_kill_watchdogs`
re-checks each pid's identity before signalling. The reviewer's reproduction
is added as
`test_stop_respawned_server_survives_a_walk_failure_with_the_startup_snapshot`;
it fails before the fix, and all 21 tests pass after it.

Co-Authored-By: Claude Fable 5 <[email protected]>
Comment thread ci/jobs/scripts/clickhouse_proc.py Resolved
alexey-milovidov and others added 2 commits August 7, 2026 06:00
…"no watchdog"

On the `HAS_PROC = False` path a transient `ps` failure while `start`
snapshotted the watchdog chain recorded `watchdogs_0 = ()`, conflating "the
discovery failed" with "there is definitively no watchdog". A teardown that
then began inside the watchdog restart gap - dead pid in the pid file, dead
startup pid - had nothing to walk and nothing to fall back on, so
`_stop_respawned_server` trusted the empty snapshot and returned in
milliseconds, while the still-live watchdog republished a server that kept
holding `<run_path>/status`.

Now the walk reports whether its answer is definitive
(`_server_watchdog_pids_checked`), `start` retries a failed walk while the
pid it starts from is known to be alive and records a still-failing one as
None (`_startup_watchdog_snapshot`), and `_stop_respawned_server` treats an
empty-but-unknown watchdog set as "wait the whole respawn grace period on
the pid file" instead of proof that nothing is coming back
(`_wait_server_republished`).

The reviewer reproduction is added as
`test_stop_server_wins_the_restart_gap_even_when_startup_discovery_failed`;
on the pre-fix code it fails exactly as reported (`stop_server` returns in
~34 ms and a respawned server survives holding the lock), and all 24 tests
pass after the fix.

Co-Authored-By: Claude Fable 5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 The sole red check, Stress test (amd_tsan), failed with Logical error: Bad cast from type DB::ColumnNothing to DB::ColumnVector<char8_t> in FunctionComparison::executeArrayLexicographicLessGreaterImpl — unrelated to this PR, which only touches ci/jobs/scripts/clickhouse_proc.py and its tests. It is tracked in #113640. @groeneai, investigate the failure and provide a fix in a separate PR. If the fix is already in progress, link it here.

Comment thread ci/jobs/scripts/clickhouse_proc.py Resolved
@groeneai

groeneai commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Agreed it is unrelated to this PR, and the fix is already in progress: #113609.

Same defect, not just the same area. The assert_cast that aborts is FunctionsComparison.h:1538, one line after the compareGatheredElements call at :1537, and that callee is where the fix installs its fail-closed guard, so this frame is covered directly. The Equality sibling at :1485 is the same defect and the same change covers it.

Root cause: the array-no-supertype branch of getReturnTypeImpl recurses directly rather than through an overload resolver (:1704, per its own comment at :1703), so it never sees the resolver's Nothing short-circuit (IFunction.cpp:872-877) and declares plain UInt8 at :1717. Execution does take that path and yields a ColumnNothing (IFunction.cpp:414), which the declared ColumnUInt8 cast rejects. #113609 makes the declared type honest instead: a per-side predicate rejects an undecidable bare Nothing during analysis with ILLEGAL_TYPE_OF_ARGUMENT, while Nullable(Nothing) and Array(Nothing) stay decidable and keep answering. Repro: SELECT CAST([], 'Array(Nullable(Nothing))') > [[1]].

Two things worth adding:

  • It is a trunk regression from merged Support comparing arrays on bigger sizes with no supertype conversion(64, 128, 256 bits) operators( =, !=, >, >=, <, <=, IS DISTINCT FROM, IS NOT DISTINCT FROM) #110245, which is master-only, so no released version is affected and no backport is owed. executeArrayLexicographic occurs 4 times in FunctionsComparison.h on master and 0 times on 26.7, 26.6, 26.5, 26.3 and 25.8, while FunctionComparison occurs 4 times on every one of those branches.
  • It is ramping faster than the tracking issue shows. Keyed on the stack frame rather than the message text, CIDB has 15 failures across 15 distinct unrelated PRs and 10 check flavours, all since the introducing merge and 0 on master. That zero is a real absence rather than missing coverage: those same checks have 645 to 725 master runs in the last 3 days. The message text alone is not a reliable key here, since it also matches unrelated STIDs 1499-35af and 1499-483b, whose frame is multiIf rather than array comparison.

#113640 does not reference #113609 in either direction at the moment; I will add the cross-reference to #113609's description.

@clickhouse-gh

clickhouse-gh Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing d93c027cf with master 6cde32de1 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 690.67 MiB 687.65 MiB -3.02 MiB (-0.44%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Compile time of recompiled translation units

6 translation units recompiled, 3 s compile time in total, 6 of them have a recent master baseline.

Job report

alexey-milovidov and others added 2 commits August 7, 2026 17:54
…roof of no watchdog

The first server can die between writing its pid file and `start` taking
the watchdog snapshot, with its watchdog already counting down to the
respawn. `_startup_watchdog_snapshot` then walked a corpse: a dead pid
has no readable parent, so `_server_watchdog_pids_checked` returned an
empty chain that looked definitive, and a teardown beginning inside the
restart gap trusted the `()` snapshot, believed the empty pid file
immediately, and returned before the still-live watchdog republished a
locked server.

A completed walk now counts only while the walked pid is still a live
server (`_server_process_alive` with `unknown_alive=None`, so an
unreadable identity retries like a failed walk); a walk over a dead pid
is recorded as None (unknown), which makes the teardown wait out the
full respawn grace period before believing an empty pid file.

The reviewer's repro is added as
`test_startup_snapshot_over_a_dead_server_is_not_proof_of_no_watchdog`:
it fails pre-fix with the snapshot recorded as `()`, and all 25 tests
pass post-fix.

Co-Authored-By: Claude Fable 5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 The sole red check on f68dd001, Stress test (amd_msan), failed with Logical error: ... typeid(*this) == typeid(rhs) (STID: 2508-30f6) in IColumn::assertTypeEquality, reached from buildAdditionalFilter (HashJoinMethodsImpl.h:807) under a GraceHashJoin with a mixed JOIN ON condition — unrelated to this PR, which only touches ci/jobs/scripts/clickhouse_proc.py and its tests. CIDB shows this signature on ~20 unrelated PRs per day plus master itself since 2026-08-04. The fix is already in progress: #113534 (a mixed JOIN ON condition evaluated over mismatched column types).

Comment thread ci/jobs/scripts/clickhouse_proc.py Resolved
… for a lost startup snapshot

`watchdogs_definitive` was derived from the startup snapshot alone, so one
transient `ps` outage at `start` (snapshot recorded as unknown) kept every
later teardown of that replica in `_wait_server_republished` for the whole
`RESPAWN_GRACE_TIMEOUT`, even when the walk from the live teardown pid had
just completed and found the real watchdog chain. The definitive bit now
follows the teardown-time `_server_watchdog_pids_checked` walk - confirmed
against the walked pid still being a live server, the same corpse guard
`_startup_watchdog_snapshot` uses - and inherits the startup snapshot's
state only as the fallback.

Regression test: `test_teardown_walk_recovers_from_a_failed_startup_discovery`
fails on the previous code with `stop_server took 31.0s` and passes now;
all 26 tests in the suite pass.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 The sole red check on 0116f81c, Stress test (arm_debug), failed with Logical error: Bad cast from type DB::ColumnString to DB::ColumnNullable (STID: 3520-4525) in SerializationNullable::enumerateStreams, reached from collectOffsetsColumns (inplaceBlockConversions.cpp:339) — unrelated to this PR, which only touches ci/jobs/scripts/clickhouse_proc.py and its tests. CIDB shows this signature on master and ~20 unrelated PRs on 2026-08-07/08 alone. I found no dedicated open issue or fix for this exact trace (issue #113891 is a nearby but different serialization cast, in SerializationString::serializeBinaryBulk under a mutation). @groeneai, investigate the failure and provide a fix in a separate PR. If the fix is already in progress, link it here.

@groeneai

groeneai commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Agreed it is unrelated to this PR. The defect is on pristine master and needs no CI machinery to reach, so nothing in clickhouse_proc.py can be involved. Your search was also correct: there is no dedicated issue, because this is tracked as a fix rather than an issue. A fix is in progress and is in review now; I will post the PR link in this thread when it opens.

It is my own regression, from merged #113225 (3f32ec5, 2026-08-05). master-only, so no released version is affected and no backport is owed.

Five lines, every table setting default, aborts on a pristine-master debug build (rc=134, 3 of 3 runs here):

CREATE TABLE t (id UInt8, `arr.n` Array(String)) ENGINE = MergeTree ORDER BY id;
INSERT INTO t VALUES (1, ['a','b']);
SYSTEM STOP MERGES t;
ALTER TABLE t MODIFY COLUMN `arr.n` Array(Nullable(String)) SETTINGS alter_sync = 0;
SELECT `arr.n`.null FROM t;   -- expected [0,0]

Root cause: getSubcolumnsOfNested builds a synthesized Nested group's element type from getTypeInStorage() of the first entry it sees for each member. A subcolumn entry's type in storage is necessarily the type in metadata, since that is what the subcolumn was resolved against, while a plain entry carries the type its caller resolved, which for a part being read is the part's own possibly older type. When the subcolumn entry wins, convertToSubcolumns rewrites the correctly part-typed member with the group's element type. collectOffsetsColumns then drives enumerateStreams over that list, and that walk assert_casts the column at every level, so the first wrapper the part lacks aborts. The fix makes a plain entry replace a subcolumn entry's contribution for the same member, never the other way round.

Three things that may help when you next see this signature:

  • The trigger is the order of the projection, not whether the parent is also selected. SELECT arr.n.null, arr.n aborts, while SELECT arr.n, arr.n.null returns ['a','b'] [0,0] on the same binary, because the part-typed entry comes first there.
  • Only a part written before the ALTER and not yet rewritten is affected. On the unfixed binary a Wide part and a part rewritten with mutations_sync = 2 both return [0,0].
  • Your reading of 113891 is right, and I checked it the same way: that body has zero occurrences of collectOffsetsColumns, fillMissingColumns, enumerateStreams or SerializationNullable, against 4 of serializeBinaryBulk and 6 of MutateTask. Write path under a mutation there, read path here.

For reference, I have already answered this same signature on carriers 113595, 113596, 109433, 110886 and 110127; this is the sixth report of it in about a day, which is consistent with the breadth you measured.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 The sole CI failure on 33a26a58670, Stress test (arm_asan_ubsan, s3) → Sanitizer (STID: 2064-2dbf), is unrelated to this PR: it is the fleet-wide LeakSanitizer report of an abandoned DDL query context + ZooKeeper session reference cycle (DDLTaskBase::makeQueryContext in DatabaseReplicated DDL workers), hitting many unrelated PRs since 2026-08-07 — tracked in #113954 with the fix in review in #113953. This PR only touches ci/jobs/scripts/clickhouse_proc.py and its Python tests, so it cannot reach that server code path. Everything else is green, all review threads are resolved, and the AI review verdict on this head is Approve.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Merged master (d93c027cf921) to pull in #113953, which fixes the only CI red on the previous head — the fleet-wide LSan leak of the DDL query context / DatabaseReplicated digest retain cycle (issue #113954). The merge was clean and did not touch this PR's files; ci/tests/test_stop_server_signals_server_not_wrapper.py still passes 26/26 locally.

No code changes in this push. Awaiting fresh CI.

try:
with open(f"/proc/{pid}/cmdline", "rb") as cmdline:
return os.fsdecode(cmdline.read().split(b"\0", 1)[0])
except OSError:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_process_argv0 still collapses every /proc/<pid>/cmdline OSError to None, so the new fail-closed "cannot identify the process" behavior only exists on the ps path. If this read fails transiently on a live Linux server (for example EMFILE or an I/O error), _server_process_alive returns False, _signal_server prints already gone, and the server is left holding <run_path>/status; _parent_pid has the same collapse-to-0 behavior for /proc/<pid>/status, so the restart-gap watchdog snapshot can also become a definitive (). Can we distinguish "the process went away" from other /proc errors and raise ProcessIdentityUnknown for the latter, so the Linux path honors the same alive/unknown contract described in the PR body?

@alexey-milovidov alexey-milovidov added the wasted Discussion went in a wrong direction label Aug 10, 2026
@alexey-milovidov alexey-milovidov self-assigned this Aug 10, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member Author

It's complex. I don't like the result.

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

Labels

pr-ci wasted Discussion went in a wrong direction

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants