Skip to content

The watchdog still depends on transitions, but the supervisor no longer uses its state machine #193

Done

Description

@onyks-os

Since 0.5.0, ttp/watchdog/supervisor.py drives the watchdog loop and handles every failure: Tor healing, integrity failures and containment through request_emergency. docs/web/explanation/watchdog-fsm.md says so too. Of WatchdogFSM (ttp/watchdog/fsm.py), production uses only:

  • initialize and shutdown;
  • the event helpers readd_watch and flush_event_buffers;
  • the attributes netlink_socket, inotify_fd, wd_real and wd_link.

The other six transitions are triggered only by tests/test_fsm.py: disconnect, reconnect, integrity_fail, heal_success, heal_fail and tamper.

Why it matters

  • Packaging. transitions is a runtime dependency only for this. Fedora and Arch do not package it, so the .rpm and the PKGBUILD bundle a wheel pinned by SHA-256 (packaging/bundled-transitions.env, VENDOR_DIR, load_machine), with tests to keep the bundle consistent. The AUR package depends on python-transitions, which exists only in the AUR.
  • Misleading code. The dead callbacks log messages the watchdog never emits, such as "Auto-healing command failed for '%s'. Triggering emergency killswitch." While debugging Depend on polkit so the packaged watchdog can heal Tor #191, the VM scenario was first written against that message.

Fix

  • Replace WatchdogFSM with a plain class that owns the netlink and inotify subscriptions, keeping its setup failures and their containment.
  • Drop transitions from pyproject.toml, the .deb, .rpm and PKGBUILD, along with the bundle, load_machine and watchdog_dependency_available.
  • Drop the tests of dead transitions and update ADR 0010.
  • Release note: the packages lose a dependency, and the AUR package can drop python-transitions.

Activity

  1. added a commit that references this issue on Dec 1, 2026
    5add761
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions