This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Multiple Sessions bug?

Tags: None
(comma "," separated)
kg
Registered Member
Posts
12
Karma
0

Multiple Sessions bug?

Wed Nov 08, 2006 2:44 pm
Sorry if this has been posted before:

When I start two instances of KTorrent on the same computer, but different login sessions (there are 2 users using KTorrent concurrently on my desktop), KTorrent will:

1) Run normally at first, with CPU usage < 10%
2) After a while... usually 5-10 minutes, the CPU usage suddenly rockets to 95-100% and stays there i.e. constantly at that value!!
3) So far, I notice this happens even when one of them wasn't downloading or seeding anything.

KTorrent is awesome btw.
George
Moderator
Posts
5421
Karma
1

Wed Nov 08, 2006 7:41 pm
Are you using the same user for those two sessions ?
kg
Registered Member
Posts
12
Karma
0

Thu Nov 09, 2006 2:38 am
Nope.
George
Moderator
Posts
5421
Karma
1

Thu Nov 09, 2006 7:37 pm
To do some local testing I allways use two sessions, and I haven't seen any excess CPU usage during these local tests (not that I really checked for it).

I will see if I can reproduce this.
kg
Registered Member
Posts
12
Karma
0

Sat Nov 11, 2006 3:45 am
Thanks!

Not just excess CPU usage though -- more like maximum CPU usage. I would check for possible infinite loops in the threads. Stopping all downloads/seeds doesn't even reduce the effect, however exiting one of the KTorrent instance restores normal function instantly i.e. <10% CPU usage.

I'm using Kubuntu Edgy 6.10 (if that helps).

Once I finish my current download, I promise to try to dig up more info about the bug, since I'm able to reproduce it anytime I want.
kg
Registered Member
Posts
12
Karma
0

Sun Nov 12, 2006 11:24 am
Test no: 1

Attributes/variables:
- Started 2 instances of KTorrent, A and B, under 2 different users.
- A was seeding 2 files.
- B was not doing anything. Loaded logviewer plugin where all components are set to "ALL".
- Both, all plugins except scanfolder and scheduler are loaded and in use. DHT is also enabled. All ports were properly forwarded weren't clashing.

Results:
- Initially, when CPU usage was normal (<10%), logviewer for B is empty
- After about 5-10 minutes, without warning, CPU usage shoots up to 100%. Logviewer output for B is as follows:

DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: finding node
DHT: starting queued task
DHT: starting queued task
DHT: starting queued task
DHT: starting queued task
DHT: starting queued task
DHT: starting queued task
DHT: got findNode request
DHT: starting queued task
DHT: got findNode request
DHT: got findNode request
DHT: got getPeers request
Cannot find RPC call
Cannot find RPC call
DHT: got findNode request
Cannot find RPC call
DHT: starting queued task
Cannot find RPC call
Cannot find RPC call
Cannot find RPC call
Cannot find RPC call
Cannot find RPC call
Cannot find RPC call
Cannot find RPC call
Cannot find RPC call
Cannot find RPC call
Cannot find RPC call
Cannot find RPC call
Cannot find RPC call
Cannot find RPC call
DHT: got getPeers request
Cannot find RPC call
Cannot find RPC call
Cannot find RPC call
DHT: got findNode request
Cannot find RPC call
Cannot find RPC call
DHT: got findNode request
DHT: got findNode request
(...goes on)

Results (cont'd):
- Both clients are still responsive, although general usage becomes slightly sluggish, which was expected.

Further action:
- Stopped seeding on A (so that neither client is doing anything). No difference.
- Closed client B. CPU usage immediately returns to normal.
George
Moderator
Posts
5421
Karma
1

Sun Nov 12, 2006 11:41 am
And if you disable DHT ?
kg
Registered Member
Posts
12
Karma
0

Sun Nov 12, 2006 12:00 pm
I was just trying that :)

Using exactly the same initial state as the first test:

- Upon starting up the second KTorrent (B), DHT was immediately disabled (was enabled by default).
- A still uses DHT.
- 30 minutes later, CPU usage was nominal.
- So I re-enabled DHT in B.
- 30 minutes later, CPU usage was still nominal.
kg
Registered Member
Posts
12
Karma
0

Sun Nov 12, 2006 12:26 pm
Test 3:

- Same initial state as first test.
- About 10-15 minutes, CPU usage soars to 100%
- While in that state, I disabled DHT from the options menu for B.
- CPU usage returns to nominal immediately.
- Logviewer output for B is as follows:

DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: refreshing bucket
DHT: finding node
DHT: starting queued task
DHT: starting queued task
DHT: starting queued task
DHT: starting queued task
DHT: starting queued task
DHT: starting queued task
Cannot find RPC call
Cannot find RPC call
Cannot find RPC call
DHT: Stopping

I guess that confirms where the bug is :)
George
Moderator
Posts
5421
Karma
1

Sun Nov 12, 2006 3:57 pm
It almost sounds like you are being bombarded with DHT packets.

Are you using the same port for DHT for both clients ?
kg
Registered Member
Posts
12
Karma
0

Mon Nov 13, 2006 12:42 am
No, the ports were distinct. Also, the bug seem to happen right after the "refreshing" line in the log always.
George
Moderator
Posts
5421
Karma
1

Mon Nov 13, 2006 9:58 am
Strange, refreshing buckets is nothing more then sending a few pings.
kg
Registered Member
Posts
12
Karma
0

Mon Nov 13, 2006 2:10 pm
Strange... what usually happens after refreshing ports then?

Hey, is KTorrent written in C++? If it is, then I might be able to do the diagnostics myself... But that'll have to wait till after my exams though.
Moshroum
Registered Member
Posts
63
Karma
0

Mon Nov 13, 2006 3:09 pm
Yes it is. See svn for more info.
kg
Registered Member
Posts
12
Karma
0

Mon Nov 13, 2006 4:12 pm
Thanks. I checked out the code. However, is there some sort of documentation I can refer to, like a doxygen one?


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar