Ticket #2016 (assigned feature-request)

Opened 16 months ago

Last modified 9 days ago

Clean exit verification with state backup

Reported by: Chotaz Owned by: Cas
Priority: minor Milestone: 1.4.0
Component: core Version: 1.3.3
Keywords: clean exit force killing cache torrent list stats Cc:

Description

I usually have a large volume of torrents attached to deluge(currently 4TB in files, indivudual torrent size goes up to 100GB) and having this large storage system, I like to periodically check my disks for errors. Yet this has been taking some time off my seeding because with this large amount of torrents, every time i try closing the deamon(pkill deluge), it doesn't quit cleanly. This makes deluge have to check 4TB of files every single time i kill or stop deluged(usually takes a full day to do so with my drives).

My idea was to add a flag on the deamon close function that gets set if it's done cleanly and a way to cache torrent stats. The flag would be verified everytime the daemon is ran again and if it wasnt found, the latest cached stats would load after all the torrent checking is done.

Change History

Changed 16 months ago by Chotaz

  • keywords clean exit force killing cache torrent list stats added
  • version changed from other (please specify) to 1.3.3
  • component changed from other to core

Changed 15 months ago by Cas

There was a recent fix applied that may be relevant here:  0676aaf91

Changed 9 days ago by Cas

  • status changed from new to assigned
  • owner set to Cas
  • milestone changed from Future to 1.4.0
  • summary changed from Clean exit verification and torrentlist stats caching to Clean exit verification with state backup

We are looking to backup the state file and restore if a non-clean shutdown was detected which I think will cover what you are asking for.

Changed 9 days ago by Cas

Actually this is the discussed pseudocode:

On startup:
 
os.path.exists("state_file_test"):
    copy("torrents.state.prev", permanent dir/name)
    copy("torrents.state", permanent dir/name)
    Warn user?
 
cp torrents.state to torrents.state.prev
 
load_state...
 
 
on shutdown:
   save state
   delete "state_file_test"
Note: See TracTickets for help on using tickets.