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 by lordkappa, 9 years ago

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 by Calum, 9 years ago

Milestone: Future1.3.x

comment:3 by Calum, 9 years ago

Component: other/unknownCore
Milestone: 1.3.xneeds verified
Resolution: WorksForMe
Status: newclosed

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 by Calum, 9 years ago

Component: Corelibtorrent
Milestone: needs verified1.3.13
Resolution: WorksForMe
Status: closedreopened

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 by Calum, 9 years ago

Component: libtorrentCore
Resolution: Fixed
Status: reopenedclosed

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.