Opened 9 years ago

Closed 9 years ago

#2750 closed bug (Fixed)

Paused torrent automatically resumes after force-recheck

Reported by: lordkappa Owned by:
Priority: minor Milestone: 1.3.13
Component: Core Version: 1.3.11
Keywords: recheck pause resume Cc:

Description

Any paused torrent will not remember it's paused state after a force-recheck, and will resume immediately upon recheck completion.

Steps to reproduce: -Add a torrent -Pause torrent -Begin a force-recheck on torrent

Expected result: Torrent performs a recheck, and returns to paused state.

Observed result: Torrent performs a recheck, and resumes; beginning downloading/seeding immediately.

I've observed in core/torrent.py that Deluge automatically stores the torrent's current state in variable forcing_recheck_paused, requests a force-recheck, and then resumes the torrent. However, this state is not being properly reinstated when on_alert_torrent_checked() in core/torrentmanager.py is called after the recheck is complete.

Change History (5)

comment:1 Changed 9 years ago by lordkappa

I submit my own fix here in the hope someone else will find it a starting point.

deluge/core/torrentmanager.py @ line 967

<       if torrent.forcing_recheck:
<            torrent.forcing_recheck = False
<            if torrent.forcing_recheck_paused:
<                torrent.handle.pause()
---
>       if torrent.forcing_recheck:
>           torrent.forcing_recheck = False
>            if torrent.forcing_recheck_paused:
>                torrent.handle.pause()
>                torrent.pause()
Last edited 9 years ago by lordkappa (previous) (diff)

comment:2 Changed 9 years ago by Cas

  • Milestone changed from Future to 1.3.x

comment:3 Changed 9 years ago by Cas

  • Component changed from other/unknown to Core
  • Milestone changed from 1.3.x to needs verified
  • Resolution set to WorksForMe
  • Status changed from new to closed

I can't replicate this issue. If still an issue please reopen with more info, e.g. version of libtorrent (test with latest), logs etc?

comment:4 Changed 9 years ago by Cas

  • Component changed from Core to libtorrent
  • Milestone changed from needs verified to 1.3.13
  • Resolution WorksForMe deleted
  • Status changed from closed to reopened

Ok while testing something else I actually managed to replicate this issue, not sure what changed but anyway it does appear to be a race condition in libtorrent and the second pause call seems to be a good workaround but it will need reporting upstream.

comment:5 Changed 9 years ago by Cas

  • Component changed from libtorrent to Core
  • Resolution set to Fixed
  • Status changed from reopened to closed

I could not see any issue with torrents actually downloading or seeding but what I thought was a libtorrent issue is a deluge display issue which is now fixed: [5c545c5e0bc42de5]

As mentioned before if this is still an issue update the ticket but I could not replicate your precise issue with 1.0.6.

Note: See TracTickets for help on using tickets.