crazy-max / docker-rtorrent-rutorrent

rTorrent and ruTorrent Docker image
MIT License
484 stars 106 forks source link

Sessions not saving between pod kills/etc, yet session files are stored on permanent storage #268

Closed BloodyIron closed 11 months ago

BloodyIron commented 1 year ago

Support guidelines

I've found a bug and checked that ...

Description

Whenever I have to kill the pod the Session files often (not always? unsure) seem to either be ignored, or regenerated, as all active torrents need to be re-checked. This has been observed for a bunch of weeks now, and I'm using "crazymax/rtorrent-rutorrent:latest".

I've checked the permanent storage and the permissions are correctly set (even within the container's perspective). I've even completely nuked all session files and regenerated them, an that has not improved this situation. I am not sure when this started being a thing.

Expected behaviour

I "expect" the sessions to persist regardless of whether a pod is killed nicely or not (except maybe not a session that was established below the session time threshhold).

Actual behaviour

I've already described this.

Steps to reproduce

I've already described this.

Docker info

This is in my k8s cluster... not sure what info to put here...

Docker Compose config

NA, k8s cluster used

Logs

I have not seen anything in logs actually mention session files or related at all.

Additional info

I'm generally a fan of Smoke Gouda, probably the best cheese ever. Now that I think about it, it has been too long since I've had some... hmmm...

BloodyIron commented 12 months ago

Still happening :/

sulaweyo commented 11 months ago

I'm running on k8s as well but do not see this behavior. What i see is that the state is lost when i restart the pod before a torrent had time to write to disk as configured via RT_SESSION_SAVE_SECONDS.

Could you share some details about your setup? Deployment or Statefulset, what pvcs have you mounted in, what backend, container runtime...

BloodyIron commented 11 months ago

@sulaweyo

Unsure all useful stuff to share so feel free to ask about more specifics and I'll do what I can to clarify :) but...:

  1. Deployment
  2. SMB-backed PV/PVCs , inside the container one mounted to /downloads and one to /data .PV's configured with dir_mode/file_mode as 0770, UID/GID as 1000, and vers as 3.0 (for both PVs).
  3. Not sure what you mean by backend, that's way too broad of a question
  4. Not entirely sure if I'm using containerd or docker this moment, but the nodes in the k8s cluster are RKE1 with k8s version "v1.23.10-rancher1-1"
BloodyIron commented 11 months ago

Okay so in my efforts to address getplugins.php being painfully slow... I stumbled upon this link: https://github.com/Novik/ruTorrent/issues/1808#issuecomment-627082490

Saying "In my case, it was because the underlying filesystem didn't support flock(). Perhaps this might be a helpful clue for you too!" (user hufman)

So I switched the storage interfacing protocol for /data from SMBv3 to NFSv3.

Now... getplugins.php is still slow af as before (same numbers).... HOWEVER!!! My Torrent Sessions seem to now be actually resuming!! Which is super confusing because the files were always visible on-disk on the storage, and I don't understand why rtorrent wouldn't resume from those files... but yeah... SO FAR in testing switching to NFS (for the /data mount point) LOOKS to have resolved my session issue... I've even deleted the pod a few times to confirm.

So getplugins.php still plagues me, but this session saving seems fine. I'm going to close for now. Hope this helps someone!

Oh, and if anyone has any good ideas on the getplugins.php slowness front, please let me know!