Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Rejecting peer because already have a peer with the same id" after node restart #105

Open
jackpal opened this issue Apr 17, 2016 · 2 comments

Comments

@jackpal
Copy link
Owner

jackpal commented Apr 17, 2016

A bug report by email:

When one node has downloaded a file and removes the file.
After this, when this node reboots Taipei-Torrent and downloads same file again.
It prints "Rejecting peer because already have a peer with the same id" and will create a empty file that same size with original file.

@jackpal
Copy link
Owner Author

jackpal commented Apr 17, 2016

Discussion:

I'm guessing that what's happening is:

Node A is serving
Node B connects to A
Node B crashes
Node B tries to reconnect to A.
Node A rejects the reconnection because it hasn't expired the original connection from node B.

This is probably normal behavior, since it takes TCP/IP a while to notice that crashed connections are timed out. but we could review the code to see if there's any way for Node A to detect that the original node B has crashed. Ideally without trying to communicate with the original node B -- don't want to be an amplification vector for DDOS attacks.

As for the "empty file that is the same size as the original file" I assume that is on node B. I thought we didn't create files until we received data for them, but maybe I'm mis-remembering, or maybe things have changed since I wrote the code. I guess it's worth investigating as well.

@liangmingyuanneo
Copy link
Contributor

No, I have also met this problem and found the reason probably. Because if I use the bittorrent as the tracker, when Taipei-Torrent client
use "startTrackerClient" function to quest from the tracker, the tracker will answer a string that contains many same peerIDs. So in my opinion, when the Taipei-Torrent client stops, it does not request the tracker to delete the peerID.

liangmingyuanneo added a commit to liangmingyuanneo/Taipei-Torrent that referenced this issue May 30, 2016
when the Taipei-Torrent client stops, it does not request the tracker to delete the peerID.
Zilog8 added a commit that referenced this issue May 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants