webtorrent / bittorrent-tracker

🌊 Simple, robust, BitTorrent tracker (client & server) implementation
https://webtorrent.io
MIT License
1.75k stars 317 forks source link

Question about warning: "no peer with that `to_peer_id`" #384

Closed geco closed 3 years ago

geco commented 3 years ago

https://github.com/webtorrent/bittorrent-tracker/blob/ff20a05e4830dd62df16da0a549e69ae96843b4d/server.js#L554

We are using peertube into a live env, and it raises a lot of errors of this type: "Error: no peer with that to_peer_id".

In a "normal" situation, when this error should be raised? Which scenario represents? A peer disconnected? Some firewall truncated connection?

NodeJS version: 14.17.1 "bittorrent-tracker": "^9.0.0"

Thanks

alxhotel commented 3 years ago

Hi @geco,

This event usually happens when the peer has disconnected before the message could be passed.

This happens either because the peer has disconnected or because the server has closed the connection with that peer due to a bad message or bad peer id.