Possible source of 'stuck checking' problem identified

Suggestions and discussion of future versions
Post Reply
industrialist19572

Possible source of 'stuck checking' problem identified

Post by industrialist19572 »

I have been having the stuck checking problem that others have
reported, and I think I found a possible source of the problem.

Basically, the manager is having a problem properly getting and/or
setting the state of a torrent that is in the checking state if there
is more than one torrent in the checking state at the time.

This can happen when restarting after a crash, and the manager
attempts to check all of the torrents concurrently. It can also happen
when adding a new torrent while another is concurrently in the
checking state, for example, when batch-adding several torrents which
require checking.

I have tested this hypothesis with a set of about twenty torrents that
are known to get stuck in checking. What I did was delete all of the
torrents, and then re-added the torrents one at a time, making sure
that the previous torrent was done checking before adding the next.
Everything was successful, and there were no torrents which got stuck
in checking.

If I go back (restarting from scratch), and try to batch-add those
same torrents, they get stuck.

Furthermore, I can force the daemon to get stuck in checking if I add
one torrent, then add another torrent before the first one finishes
checking.

I think that the offending code is in:

deluge/core/torrentmanager.py

or it's possibly a combination with the function:

update_state in deluge/core/torrent.py
Post Reply