-
Notifications
You must be signed in to change notification settings - Fork 454
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
peerRouting.findPeer() trying to find self returns AggregateError instead more suitable error #827
Comments
Throwing a dial self error here doesn't really make sense. Ideally the Is there a particular reason you're trying to find self, or is this just do to generic findPeer(peer) and peer happens to be self in some instances? |
Background: But thats how I found this bug. The AggregateError Message is in my opinion not very describing. Maybe a new Error message Is there a more elegant way to find all peers in a network in a few seconds? I tried the randomWalk of the DHT, but it took too long. |
DHT performance currently needs to be improved, it's on our short list of improvements to make to get it inline with the recent go updates that were made this year. This won't be viable in browsers, especially on larger networks, but it should work well for Node once it's improved.
I agree that the aggregate error messaging could be improved. It's possible that multiple errors could be associated with a query because we can potentially use multiple peer routers. This could change in the future if we change the routing calls to be more explicit (declaring whether you're using the DHT or something else) thus removing the need to collect all errors. Regardless of this we should make the errors easier to debug/consume. |
Are you sure This is my output: Like @jacobheun said, Edit: The error originates from KadDHT.findPeer(). I was able to resolve the issue by adding: |
@zeim839 why not adding this validation in |
@vasco-santos I wasn't sure If that was possible because I was previously testing on @a1300 's version of libp2p. Once updated, I was able to add the validation as mentioned. I created a pull request to address this here |
Closed by #942 and will be shipped in |
Type: Bug
Severity: Low
Description: When I try to find myself with
peerRouting.findPeer()
I get aAggregateError: No peer found
instead of a more suitable error likeERR_DIALED_SELF
Steps to reproduce the error:
git clone https://gist.github.com/a1300/be916e343940c321aae587fd10cc3478 libp2p-peerRouting-find-self cd libp2p-peerRouting-find-self npm install node index
Output:
The text was updated successfully, but these errors were encountered: