jlouis / etorrent

Erlang Bittorrent Client
BSD 2-Clause "Simplified" License
294 stars 50 forks source link

Endgame mode #148

Open arcusfelis opened 11 years ago

arcusfelis commented 11 years ago

There is a bug with it. The torrent stays at 98.0%-99%. Restart helps, but before the next endgame (i.e. if first stop was on 98%, next will be somewhere near 99%).

It is very hard to test due to the short period of the endgame. Common tests do not help (maybe because one remote peer is not enough for this bug to occur). Maybe it caused by a race condition. The data is not not written (i.e. different hashes of the pieces on the disk and in the torrent-file) and the endgame assignor do not assign new chunks (returns all assigned), when it is requested for peer_control.

Also, eunit tests in the module etorrent_endgame do not fails. I added few functions for logging and for live debugging into etorrent_endgame and into etorrent_progress files (the code is already merged).

jlouis commented 11 years ago

I'll try to read the code and figure out what is happening in it later today.