webseed slow to stop problem
Posted: Fri Nov 02, 2012 5:16 pm
webseed torrents can be very slow to pause/stop which can lead to problems if you choose
'Trash Data & Remove From List' on an actively downloading webseed torrent(s).
It has been months since I've looked at this issue but I do remember that in about 1 out of 25
'Trash Data & Remove From List' I would get a crash.
If you pause/stop actively downloading webseed torrent(s) many times you will see the torrent(s) in a stopped/paused state with a high downloading transfer rate for a long time after (from like 5 seconds to a minute or so).
see:
https://trac.transmissionbt.com/ticket/4576#comment:13
and
https://trac.transmissionbt.com/ticket/4644#comment:19
Here is the patch that I have been using for a long time and have not gotten a crash since using it. The patch won't allow
'Trash Data & Remove From List' on running torrent(s) with webseed. With this patch 'Trash Data & Remove From List' will only pause/stop running webseed torrents, then once stopped choose again 'Trash Data & Remove From List'. Non webseed torrents behavior is not changed. Already paused/stopped torrents behavior is not changed.
https://trac.transmissionbt.com/ticket/5069 and https://trac.transmissionbt.com/ticket/5063 have addressed some issues pertaining to webseeds with magnetlinks however the slow to pause/stop problems have nothing to do with magnetlinks.
'Trash Data & Remove From List' on an actively downloading webseed torrent(s).
It has been months since I've looked at this issue but I do remember that in about 1 out of 25
'Trash Data & Remove From List' I would get a crash.
If you pause/stop actively downloading webseed torrent(s) many times you will see the torrent(s) in a stopped/paused state with a high downloading transfer rate for a long time after (from like 5 seconds to a minute or so).
see:
https://trac.transmissionbt.com/ticket/4576#comment:13
and
https://trac.transmissionbt.com/ticket/4644#comment:19
Here is the patch that I have been using for a long time and have not gotten a crash since using it. The patch won't allow
'Trash Data & Remove From List' on running torrent(s) with webseed. With this patch 'Trash Data & Remove From List' will only pause/stop running webseed torrents, then once stopped choose again 'Trash Data & Remove From List'. Non webseed torrents behavior is not changed. Already paused/stopped torrents behavior is not changed.
Code: Select all
--- J:/!/WebSeedMagDbFree/pcTMP-&-regular-Work/svn/rpcimpl.c.13504.c Fri Nov 2 11:05:23 2012
+++ J:/!/WebSeedMagDbFree/pcTMP-&-regular-Work/svn/rpcimpl.c Fri Nov 2 11:17:39 2012
@@ -345,9 +345,22 @@
for( i=0; i<torrentCount; ++i )
{
tr_torrent * tor = torrents[i];
+
+ if( tor->isRunning && ( tor->info.webseedCount > 0 ) )
+ /* disable removing actively running torrents with webseeds until
+ bandwidth-pulse stops the transfer first
+ fixes crash of improperly interupting peer-io callback call chain
+ SRS -- https://trac.transmissionbt.com/ticket/4576#comment:13 */
+ {
+ tor->isStopping = true;
+ notify( session, TR_RPC_TORRENT_STOPPED, tor );
+ }
+
+ else {
const tr_rpc_callback_status status = notify( session, type, tor );
if( !( status & TR_RPC_NOREMOVE ) )
tr_torrentRemove( tor, deleteFlag, NULL );
+ }
}
tr_free( torrents );