Opened 12 years ago

Closed 7 years ago

Last modified 5 years ago

#2016 closed feature-request (Fixed)

Clean exit verification with state backup

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


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 (9)

comment:1 Changed 12 years ago by Chotaz

  • Component changed from other to core
  • Keywords clean exit force killing cache torrent list stats added
  • Version changed from other (please specify) to 1.3.3

comment:2 Changed 12 years ago by Cas

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

comment:3 Changed 11 years ago by Cas

  • Milestone changed from Future to 1.4.0
  • Owner set to Cas
  • Status changed from new to assigned
  • 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.

comment:4 Changed 11 years ago by Cas

Actually this is the discussed pseudocode:

On startup:
    copy("torrents.state.prev", permanent dir/name)
    copy("torrents.state", permanent dir/name)
    Warn user?
cp torrents.state to torrents.state.prev
on shutdown:
   save state
   delete "state_file_test"

comment:5 Changed 11 years ago by Cas

I have committed code 2c4ef9dbb30 that achieves the above pseudocode but still require some form of user notification.

comment:6 Changed 9 years ago by Cas

  • Milestone changed from 1.4.0 to 2.0.0

comment:7 Changed 8 years ago by bro

  • Cc bro added

Add bro to cc

comment:8 Changed 7 years ago by Cas

  • Resolution set to Fixed
  • Status changed from assigned to closed

Updated to use tarfile: [45e0d1093]

It is possible that might need to add code to delete old archives but since shutting down in more robust this should be less of an issue.

comment:9 Changed 5 years ago by Cas

  • Milestone changed from 2.0 to 2.0.0

Milestone renamed

Note: See TracTickets for help on using tickets.