Bug 415246

Summary: ktorrent stalls after time until reboot
Product: [Applications] ktorrent Reporter: Tom B <tom>
Component: generalAssignee: Joris Guisson <joris.guisson>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version: 5.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Tom B 2019-12-16 14:51:17 UTC
SUMMARY

When using ktorrent, after some time (days) connection speeds drop and it seems unable to connect to peers/seeds. Rebooting the PC fixes it. 

I just had one torrent that had been stalled for 12 hours though it was showing several seeders. Occasionally I'd get 20kbps for a short period (30 seconds or so) I rebooted and immediately saw 1.8mb/s downloads 

This seems to be a fairly common issue: 

https://forums.linuxmint.com/viewtopic.php?t=29631

The author there says: 

"I also have to restart it every other day, it seems to 'clog' up (don't know how to explain it) and a lot of the torrents start 'stalling' - a restart fixes it"

Here's another mention of it: https://forum.kde.org/viewtopic.php?t=105632

and a similar bug: https://bugs.kde.org/show_bug.cgi?id=275889


Which is also exactly what I'm seeing 10 years later. 

Restarting ktorrent doesn't help, only a reboot.

STEPS TO REPRODUCE
1. Start a torrent
2. Leave it going for several days

OBSERVED RESULT

The torrent stops downloading until reboot. 

EXPECTED RESULT

The torrent should maintain speed/connections regardless of how many hours it has been running.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: Linux 5.4.3, ktorrent 5.1, plasma 5.17


ADDITIONAL INFORMATION

It's as if there is some kind of system limit being hit which prevents ktorrent creating any more connections. I've tried increasing the connection limit in ktorrent and it doesn't seem to help. 

Whatever it's doing behind the scenes, it doesn't seem to free the resources when closed, only when rebooted. Whether it's ports, mutexes, semaphore message queue limits,  or some other system wide restriction, whatever it is, it uses it up and doesn't ever free the resources until the system is rebooted.