Hi there,
I'm one of the maintainers of the debian package of BitTornado, and I've seen a couple of bugs recently posted for this error:
Debian bug #401056
Ubuntu bug #79227
BitTorrent T-0.3.17 (BitTornado)
OS: linux2
Python version: 2.4.4c0 (#2, Jul 30 2006, 15:43:58)
[GCC 4.1.2 20060715 (prerelease) (Debian 4.1.1-9)]
wxWindows version: 2.6.3.2
Allocation method: normal
Traceback (most recent call last):
File "/var/lib/python-support/python2.4/BitTornado/RawServer.py", line 144, in listen_forever
self.sockethandler.handle_events(events)
File "/var/lib/python-support/python2.4/BitTornado/SocketHandler.py", line 319, in handle_events
s.handler.data_came_in(s, data)
File "/var/lib/python-support/python2.4/BitTornado/BT1/Encrypter.py", line 175, in data_came_in
x = self.next_func(m)
File "/var/lib/python-support/python2.4/BitTornado/BT1/Encrypter.py", line 133, in read_message
self.connecter.got_message(self, s)
File "/var/lib/python-support/python2.4/BitTornado/BT1/Connecter.py", line 234, in got_message
c.download.got_unchoke()
File "/var/lib/python-support/python2.4/BitTornado/BT1/Downloader.py", line 127, in got_unchoke
self._request_more(new_unchoke = True)
File "/var/lib/python-support/python2.4/BitTornado/BT1/Downloader.py", line 237, in _request_more
self.downloader.start_endgame()
File "/var/lib/python-support/python2.4/BitTornado/BT1/Downloader.py", line 567, in start_endgame
assert not self.endgamemode
AssertionError
It seems like maybe sometimes another thread is changing the endgamemode during the execution of the _request_more function, as I don't see how else this error could error. This code in _request_more():
Code:
if self.downloader.endgamemode:
self.fix_download_endgame(new_unchoke)
return
should catch all endgamemode and not allow the function to continue.
I wonder if this actually occurs more often, but rarely gets reported as the error doesn't cause the program to fail. Is this the desired way to handle this situation? Or, could a workaround to it be implemented, perhaps in Downloader.py:
Code:
def start_endgame(self):
if self.endgamemode
return
self.endgamemode = True
...
What do you think?