the forums at degreez.net

It is currently Wed Jun 20, 2018 4:53 am

All times are UTC - 7 hours [ DST ]




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: tracker problems
PostPosted: Sun Apr 08, 2007 5:18 am 
Offline

Joined: Sun Apr 08, 2007 4:29 am
Posts: 2
I keep on getting this error when I run a tracker. And it crashes like every minute or two.

The tracker has about 4000 peers and is running on a machine with python 2.3.3 installed.

Code:
Traceback (most recent call last):
  File "/root/BitTornado-CVS/BitTornado/RawServer.py", line 142, in listen_forever
    self.sockethandler.handle_events(events)
  File "/root/BitTornado-CVS/BitTornado/SocketHandler.py", line 319, in handle_events
    s.handler.data_came_in(s, data)
  File "/root/BitTornado-CVS/BitTornado/HTTPHandler.py", line 155, in data_came_in
    if not c.data_came_in(data) and not c.closed:
  File "/root/BitTornado-CVS/BitTornado/HTTPHandler.py", line 46, in data_came_in
    self.next_func = self.next_func(val)
  File "/root/BitTornado-CVS/BitTornado/HTTPHandler.py", line 78, in read_header
    r = self.handler.getfunc(self, self.path, self.headers)
  File "/root/BitTornado-CVS/BitTornado/BT1/track.py", line 917, in get
    rsize = self.add_data(infohash, event, ip, paramslist)
  File "/root/BitTornado-CVS/BitTornado/BT1/track.py", line 692, in add_data
    bc[1][myid] = bc[0][myid]
KeyError: 'exbc\x01\x01LORDv\xc6\xea\xd7\xfc.\xc6\x7f\xe7\xe6'


Top
 Profile  
 
 Post subject: Re: tracker problems
PostPosted: Sun Apr 29, 2007 5:07 pm 
Offline

Joined: Thu Mar 23, 2006 7:52 pm
Posts: 22
cartman-2000 wrote:
Code:
Traceback (most recent call last):
  File "/root/BitTornado-CVS/BitTornado/RawServer.py", line 142, in listen_forever
    self.sockethandler.handle_events(events)
  File "/root/BitTornado-CVS/BitTornado/SocketHandler.py", line 319, in handle_events
    s.handler.data_came_in(s, data)
  File "/root/BitTornado-CVS/BitTornado/HTTPHandler.py", line 155, in data_came_in
    if not c.data_came_in(data) and not c.closed:
  File "/root/BitTornado-CVS/BitTornado/HTTPHandler.py", line 46, in data_came_in
    self.next_func = self.next_func(val)
  File "/root/BitTornado-CVS/BitTornado/HTTPHandler.py", line 78, in read_header
    r = self.handler.getfunc(self, self.path, self.headers)
  File "/root/BitTornado-CVS/BitTornado/BT1/track.py", line 917, in get
    rsize = self.add_data(infohash, event, ip, paramslist)
  File "/root/BitTornado-CVS/BitTornado/BT1/track.py", line 692, in add_data
    bc[1][myid] = bc[0][myid]
KeyError: 'exbc\x01\x01LORDv\xc6\xea\xd7\xfc.\xc6\x7f\xe7\xe6'


I get the same error, though with a different key of course. It only occurs when a peer changes from a downloader to a seed. It also only seemed to start happening when I changed --nat_check to 0 to solve some connection problems I was having. It solved those problems, but created this one.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 10, 2007 6:16 pm 
Offline

Joined: Thu Mar 23, 2006 7:52 pm
Posts: 22
I was able to prevent this error using this minor change. Change this (around line 692):
Code:
for bc in self.becache[infohash]:
    bc[1][myid] = bc[0][myid]
    del bc[0][myid]

to this:
Code:
for bc in self.becache[infohash]:
    if bc[0].has_key(myid):
        bc[1][myid] = bc[0][myid]
        del bc[0][myid]


to be safe, you can also make a similar change a few lines below (around line 699) from this:
Code:
for bc in self.becache[infohash]:
    bc[0][myid] = bc[1][myid]
    del bc[1][myid]

to this:
Code:
for bc in self.becache[infohash]:
    if bc[1].has_key(myid):
        bc[0][myid] = bc[1][myid]
        del bc[1][myid]

this one will only occur rarely though, when a peer changes from a seed to a downloader.

I haven't noticed any side effects of this change (other than the error going away), but maybe theShadow can confirm this.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group