bugThe Circle - Bugs: bug #3532, the method for finding peers is...

 
 

bug #3532: the method for finding peers is inaccurate

Submitted by:  ThomasV <thomasV>
Submitted on:  Sat 10 May 2003 01:33:01 PM UTC  
 
Category: InternalSeverity: 5 - Important: no release until fixed
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 12 May 2003 06:36:02 AM UTC, comment #1:

Waiter is useful, but it has to wait for the correct thing :-)

Added "is_connecting" to node class, waiter now waits until node is no longer connecting.

"couldnt find peers" window should now appear only if there really are no peers.

Paul Harrison <pfh>
Project Administrator
Sat 10 May 2003 01:33:01 PM UTC, original submission:

On startup, I sometimes have the "couldnt find any peers" window popping up, even though it does find some peers, which are displayed on the blue thingy..

This happens to me at home, since I have a DSL connection that induces some latency. Here is why it occurs:

During the initialization of app.node, peers are greeted like this:

self.found_peers = self.greet_known_peers()

In circle.py (run_main routine), a "waiter" waits for greet_known_peers to return:

if not no_connect:
def waiter(node):
if hasattr(node, 'found_peers'):
utility.threadnice_mainquit()
return gtk.FALSE
return gtk.TRUE
utility.schedule_mainthread(250.0, waiter, self.node)
utility.threadnice_mainloop()

this means wait 250 ms, and then wait until
greet_known_peers is done. after that, the
routine checks for peers:

any = (len(self.node.peers) <> 0)

The problem is that greet_known_peers returns immediately.
So there is no point using this "waiter"...
In fact, greet_known_peers launches a number of threads,
and then it returns. These threads do the job of calling the peers, and update node.peers.

So greet_known_peers returns before these threads have updated node.peers. And if it takes more than 250ms to contact the first peer, then circle becomes confused
and says that it could not find any peer.

workaround: I replaced 250ms by 1000ms on my system,
given that my connection has more latency than a T1.

fix: I suggest two things:
1. to remove the "waiter", because it is not doing anything useful. I guess it is a fossil of an ancient time, where greet_known_peers was not launching threads.
2. The "couldnt find any peers" window is useful, we should keep it. But it should show up later if the connection is slow. Maybe circle could maintain an average of how long it takes to connect, and complain only if it takes more than 10 times this average time. Initially, this average time would be set to a high value.

Feedback welcome...

ThomasV <thomasV>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Mon 12 May 2003 06:36:02 AM UTCpfhStatusNone=>(Error - Not Found)
  Open/ClosedOpen=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1