fix: restart deluge-web when deluged is restarted by watchdog#443
Open
partymola wants to merge 1 commit into
Open
fix: restart deluge-web when deluged is restarted by watchdog#443partymola wants to merge 1 commit into
partymola wants to merge 1 commit into
Conversation
d086284 to
dd92556
Compare
When deluged crashes (e.g. due to a segfault in libtorrent) and the watchdog restarts it, deluge-web is left running with a stale RPC connection to the old daemon. It enters an endless connect/disconnect loop and the Web UI is stuck on the Connection Manager screen until the entire container is restarted. Fix this by stopping deluge-web before starting a new deluged instance so that both processes start fresh. The existing logic at the bottom of deluge.sh already handles starting deluge-web when deluge_web_running is "false".
dd92556 to
681ebf0
Compare
Author
|
Hi, just checking if you've had a chance to look at this. Happy to address any feedback. |
|
Looks great to me! I have run into this issue myself. |
partymola
added a commit
to partymola/arch-delugevpn
that referenced
this pull request
Apr 11, 2026
- Add GitHub Actions workflow to build and push to ghcr.io/partymola/arch-delugevpn - Remove upstream binhex workflows (reference secrets and reusable workflows not available on fork) - Update README to describe fork differences: rebuilt image with libtorrent 2.0.12+, watchdog fix (PR binhex#443), planned nftables support
Author
|
Just a heads up - I've created a fork at partymola/arch-delugevpn that includes this fix, is fully up to date with upstream, and has rebuilt images with current Arch packages (libtorrent 2.0.12, Python 3.14). It also includes the build fixes from #446 (7zip URL and python path resolution). Images are available at @Makerblaker in case it's useful for you too. |
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.
When
delugedcrashes (e.g. segfault in libtorrent) and the watchdog restarts it,deluge-webis left running with a stale RPC connection to the old daemon.It enters an endless connect/disconnect loop every ~2s:
The web UI loads but gets stuck on the Connection Manager screen. Only fix is restarting the whole container.
Root cause: in
deluge.sh, whendeluge_running == "false"the daemon gets restarted, butdeluge-webis only started whendeluge_web_running == "false". Since the web process is still alive (just with a broken RPC connection), it never gets restarted.deluge-webdoesn't reconnect on its own when the daemon PID changes.Fix: single file change in
apps/nobody/deluge.sh. Before restartingdeluged, killdeluge-webwith SIGTERM and setdeluge_web_running="false". The logic futher down indeluge.shthen starts it fresh alongside the new daemon.Reproduced on
binhex/arch-delugevpn:latest, Deluge 2.2.0, libtorrent 2.0.11-4, Python 3.13.7, boost 1.88.0-3. Confirmed viacoredumpctlthatdelugedsegfaults periodicaly in libtorrent which triggers the watchdog restart path.