[PR #3428] [MERGED] parity: catch SIGHUP only where it exists, so parity.py starts on Windows #4970

Closed
opened 2026-11-03 05:09:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3428
Author: @d3grando
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: win-parity-sighup


📝 Commits (1)

  • 2882f07 parity: catch SIGHUP only where it exists, so parity.py starts on Windows

📊 Changes

2 files changed (+13 additions, -3 deletions)

View changed files

📝 tests/test_parity_runner.py (+9 -0)
📝 tools/parity.py (+4 -3)

📄 Description

🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves.

What and why

tools/parity.py stops on Windows before it does anything: exit_on_termination() (from #2486) registers
signal.SIGHUP, and Python's signal module has no SIGHUP there ("Availability: Unix",
https://docs.python.org/3/library/signal.html#signal.SIGHUP; on Windows signal.signal() only takes SIGABRT,
SIGFPE, SIGILL, SIGINT, SIGSEGV, SIGTERM and SIGBREAK). Every command, including --list, --changed
and --status, and the local harness run pr_ready.py starts, died with:

  File "tools\parity.py", line 1147, in exit_on_termination
    for number in (signal.SIGTERM, signal.SIGHUP):
                                   ^^^^^^^^^^^^^
AttributeError: module 'signal' has no attribute 'SIGHUP'

SIGTERM is still caught on every platform, and SIGHUP wherever the platform has it, so nothing changes on Linux
or macOS. A new test, test_termination_signals_are_caught_where_they_exist, checks both cases with a stand-in
signal module, so it covers the Windows case on Linux CI as well (it fails on the old code on any host).

The maintainers can't see this on Linux/macOS; tested on Windows 11:

  • before, on origin/main: python tools/parity.py --list food → the AttributeError above; the new test →
    AttributeError: 'types.SimpleNamespace' object has no attribute 'SIGHUP', FAILED (errors=1);
  • after: python tools/parity.py --list food → food / 1 of 356 harnesses would run;
    python tools/parity.py --changed origin/main --list lists the affected harnesses;
    python -m unittest tests.test_parity_runner → Ran 36 tests ... OK (skipped=1).

This only lets parity.py start and select harnesses on Windows. Running harnesses there needs more (fcntl,
os.killpg, resource), which is out of scope here.

Vanilla reference

None: developer tooling only.

Self-check

The one Python failure is test_port_publish.test_body_has_names_and_signatures_only, a separate Windows-only
failure that #3076 fixes; everything else passes.

pr_ready (tools/pr_ready.py --quick on DESKTOP-J80C959, against origin/main at 142388e1c, 1 min 1 s)

Check Result
Scope ✅ 2 files, +13 −3
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 409 run, FAILED (failures=1, skipped=2) (1 min 0 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label skip-release

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3428 **Author:** [@d3grando](https://github.com/d3grando) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `win-parity-sighup` --- ### 📝 Commits (1) - [`2882f07`](https://github.com/horizon-rust/horizon/commit/2882f0764d60db257743526d7dfb6d13508d122f) parity: catch SIGHUP only where it exists, so parity.py starts on Windows ### 📊 Changes **2 files changed** (+13 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_parity_runner.py` (+9 -0) 📝 `tools/parity.py` (+4 -3) </details> ### 📄 Description > 🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves. ## What and why `tools/parity.py` stops on Windows before it does anything: `exit_on_termination()` (from #2486) registers `signal.SIGHUP`, and Python's `signal` module has no `SIGHUP` there ("Availability: Unix", <https://docs.python.org/3/library/signal.html#signal.SIGHUP>; on Windows `signal.signal()` only takes `SIGABRT`, `SIGFPE`, `SIGILL`, `SIGINT`, `SIGSEGV`, `SIGTERM` and `SIGBREAK`). Every command, including `--list`, `--changed` and `--status`, and the local harness run `pr_ready.py` starts, died with: ``` File "tools\parity.py", line 1147, in exit_on_termination for number in (signal.SIGTERM, signal.SIGHUP): ^^^^^^^^^^^^^ AttributeError: module 'signal' has no attribute 'SIGHUP' ``` `SIGTERM` is still caught on every platform, and `SIGHUP` wherever the platform has it, so nothing changes on Linux or macOS. A new test, `test_termination_signals_are_caught_where_they_exist`, checks both cases with a stand-in `signal` module, so it covers the Windows case on Linux CI as well (it fails on the old code on any host). The maintainers can't see this on Linux/macOS; tested on Windows 11: - before, on `origin/main`: `python tools/parity.py --list food` → the `AttributeError` above; the new test → `AttributeError: 'types.SimpleNamespace' object has no attribute 'SIGHUP'`, `FAILED (errors=1)`; - after: `python tools/parity.py --list food` → `food` / `1 of 356 harnesses would run`; `python tools/parity.py --changed origin/main --list` lists the affected harnesses; `python -m unittest tests.test_parity_runner` → `Ran 36 tests ... OK (skipped=1)`. This only lets parity.py start and select harnesses on Windows. Running harnesses there needs more (`fcntl`, `os.killpg`, `resource`), which is out of scope here. ## Vanilla reference None: developer tooling only. ## Self-check The one Python failure is `test_port_publish.test_body_has_names_and_signatures_only`, a separate Windows-only failure that #3076 fixes; everything else passes. **pr_ready** (`tools/pr_ready.py --quick` on DESKTOP-J80C959, against origin/main at 142388e1c, 1 min 1 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +13 −3 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 409 run, FAILED (failures=1, skipped=2) (1 min 0 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | `skip-release` | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:09:17 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4970
No description provided.