Skip to content

Fix watchdog PID mismatch when running under uvx - #32

Merged
vpetersson merged 1 commit into
masterfrom
fix/watchdog-pid-mismatch
Apr 25, 2026
Merged

Fix watchdog PID mismatch when running under uvx#32
vpetersson merged 1 commit into
masterfrom
fix/watchdog-pid-mismatch

Conversation

@vpetersson

Copy link
Copy Markdown
Contributor

Summary

  • Remove the WATCHDOG_PID check in _maybe_start_watchdog — since uvx wraps the Python process, the PID never matches, causing the watchdog to disable itself and systemd to kill the service after 30s.
  • Change NotifyAccess=mainNotifyAccess=all in the systemd service file so the kernel accepts sd_notify from the child process.
  • Bump version to 0.6.2.

Test plan

  • Deploy and verify journalctl -u pypi-tea shows "systemd watchdog active" instead of "WATCHDOG_PID does not match"
  • Confirm service stays running past the 30s watchdog timeout

🤖 Generated with Claude Code

The uvx wrapper spawns Python as a child process, so WATCHDOG_PID
(set by systemd to the main PID) never matches os.getpid() inside
the app.  This caused the watchdog loop to disable itself, leading
to a 30s timeout and service restart.

- Remove the WATCHDOG_PID check in _maybe_start_watchdog — the
  systemd unit already uses NotifyAccess=all so the kernel accepts
  sd_notify from any process in the cgroup.
- Change NotifyAccess=main → NotifyAccess=all in the service file.
- Bump version to 0.6.2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vpetersson
vpetersson merged commit d812f74 into master Apr 25, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant