Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#3453 closed Bug (fixed)

Torrent does not stop when set per torrent seed ratio is reached before torrent is completed

Reported by: tarr Owned by: Longinus00
Priority: Normal Milestone: 2.10
Component: libtransmission Version: 2.00
Severity: Normal Keywords: backport-2.0x
Cc:

Description

When setting a seed ratio manually for a torrent and the torrent completes after the seed ratio is reached, the torrent is not stopped. To reproduce set a very low ratio, like 0.1.

Observed with transmission-daemon since version 2.0 in combination with transmission-remote-dotnet.

Change History (9)

comment:1 Changed 11 years ago by livings124

Are you saying the transfer is still downloading when the seed ratio is set? If so, this is intentional- the setting only applied when the download is complete.

comment:2 Changed 11 years ago by tarr

No. When the set seed ratio is reached or exceeded while the torrent is downloading it does not stop once it is completed, even though the ratio is already reached.

comment:3 Changed 11 years ago by livings124

#3498 appears to be a duplicate of this.

comment:4 Changed 11 years ago by Longinus00

tarr, can you make sure this patch works for you?

--- libtransmission/torrent.c
+++ libtransmission/torrent.c
@@ -1599,8 +1599,10 @@ verifyTorrent( void * vtor )
 
     /* if the torrent's running, stop it & set the restart-after-verify flag */
     if( tor->startAfterVerify || tor->isRunning ) {
+        /* don't clobber isStopping */
+        const tr_bool startAfter = tor->isStopping ? FALSE : TRUE;
         tr_torrentStop( tor );
-        tor->startAfterVerify = TRUE;
+        tor->startAfterVerify = startAfter;
     }
 
     /* add the torrent to the recheck queue */

comment:5 Changed 11 years ago by Tarr

Thanks for the patch Longinus00, but unfortunatly it does not change the issue. What I observe is that I set and activate a per torrent seed ratio, 0.0 to make it simple to test. When the torrent completes it moves the data to my other partition, rechecks it and then starts seeding. Looking into the torrent properties the seed ratio enable is now no more set, so it will probably seed past the set systemwide seed limit aswell.

comment:6 Changed 11 years ago by charles

  • Version changed from 2.00+ to 2.00

comment:7 Changed 11 years ago by Longinus00

  • Component changed from Daemon to libtransmission
  • Keywords backport-2.0x added
  • Milestone changed from None Set to 2.10
  • Owner set to Longinus00

This regression was introduced in the fix for #3407. All the ratio checks use tr_torrentIsSeed to prevent over-ratio downloads from hitting the trigger, but tr_torrentIsSeed relies on a cached value, tor->completeness, which isn't updated until inside tr_torrentRecheckCompleteness. This manifested as comment 3 in #3407 and this bug.

comment:8 Changed 11 years ago by Longinus00

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r11264.

When backporting note that tr_torrentCheckSeedLimit is tr_torrentCheckSeedRatio in the 2.0x branch.

comment:9 Changed 11 years ago by charles

backported to 2.0x by r11468

Note: See TracTickets for help on using tickets.