Fix watchdog PID mismatch when running under uvx - #32
Merged
Conversation
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>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WATCHDOG_PIDcheck in_maybe_start_watchdog— sinceuvxwraps the Python process, the PID never matches, causing the watchdog to disable itself and systemd to kill the service after 30s.NotifyAccess=main→NotifyAccess=allin the systemd service file so the kernel acceptssd_notifyfrom the child process.Test plan
journalctl -u pypi-teashows "systemd watchdog active" instead of "WATCHDOG_PID does not match"🤖 Generated with Claude Code