8000 rpc: a worker that aborts is indistinguishable from one that stopped, so a crash reports success · Issue #84 · nixidae/nixidae · GitHub
[go: up one dir, main page]

Skip to content

rpc: a worker that aborts is indistinguishable from one that stopped, so a crash reports success #84

Closed

Description

@Lillecarl

What

Nothing under nanopynix/rpc/ reads the exit status of a worker process.
grep -rn "returncode\|exitcode" nanopynix/src/nanopynix/rpc/ returns
nothing. The parent sees the transport close and knows that the worker went
away, never how.

An orderly shutdown, a SIGKILL from a test, and an abort() from a failed
C assertion therefore all present the same way: a stream that ended.

Evidence

A run of the whole suite against nanopynix-tests-nix_2_34-nogc reported
2077 passed, 13 skipped and the systemd unit reported Result=success. A
worker core-dumped inside that run:

22:08:18  PID 533673  SIGABRT  si_code: SI_USER
Command Line: 'nanopynix (daemon)'
User Unit: nanopynix-fork-final.service

The run window was 22:03 to 22:15, and the process is in the cgroup of the
unit. Nothing in the report mentions it.

The abort is not yet explained, and this issue is not about that abort. It
is about the parent having no way to tell. The tests that kill a worker use
SIGKILL, and the one module whose subject is a deliberate SIGABRT asserts
returncode == 0 in every case, so neither accounts for it.

Why an exception in the child cannot solve this

Three tiers of failure cross the worker boundary, and only two of them can
become an exception:

in the worker reaches the caller as an exception?
Python raised yes, and it keeps its class -- the status trailer carries ErrorIdentity
C++ threw a nix::Error yes, the binding converts it first
abort(), a failed assert, std::terminate never

abort() raises SIGABRT with the default handler. The process ends at that
instant. No stack unwinds, no except runs, nothing is pickled and sent.
There is no moment at which the worker could report.

The death is still observable, in the parent.
multiprocessing.Process.exitcode gives -6 for SIGABRT, -9 for
SIGKILL and -11 for SIGSEGV. That value is available now and discarded.

What to build

  • Read the exit code of a worker before deciding what its disappearance
    meant.
  • A negative exit code that the pool did not ask for becomes its own
    exception, which names the signal, rather than a generic disconnect.
  • A test that kills a worker on purpose says so, so that an expected -9
    stays expected and an unexpected -6 does not.

Where the new class sits in the exception hierarchy is part of the work.
This repository already has a worker-death taxonomy, and a new class has to
join it rather than sit beside it.

Why it matters beyond the tests

The ASAN and no-collector jobs exist to find memory errors. A sanitizer
report that kills a worker currently reaches the result only if its text
lands in a log that a later grep reads. An exit code that the parent
already has is a stronger signal than that.

A consumer gets the same repair for free: an aborting worker today looks like
a worker that finished.

Acceptance criteria

  • A worker killed by a signal the pool did not request raises an exception
    that names the signal.
  • A test that kills a worker on purpose still passes, and says that it meant
    to.
  • The suite fails when a worker aborts.

Tests

  • A worker sent SIGABRT from outside the pool, and the exception the caller
    receives.
  • The existing worker-death tests, which must keep passing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    source: nanopynix

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0