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

Task to find closest peers fails when no peer is connected #1160

Closed
odesenfans opened this issue Feb 20, 2022 · 2 comments
Closed

Task to find closest peers fails when no peer is connected #1160

odesenfans opened this issue Feb 20, 2022 · 2 comments
Labels
need/author-input Needs input from the original author

Comments

@odesenfans
Copy link

odesenfans commented Feb 20, 2022

  • Version: 0.36.2

  • Platform: Linux odesenfans-desktop 5.13.0-28-generic 20.04.1-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux

  • Subsystem: Peer Routing

Severity: Low

Description:

The _findClosestPeersTask task from the peer routing module throws an error when no peer is connected. I am using the JS libp2p daemon for an application and I noticed errors in the logs when starting the daemon in debug mode:

  libp2p:peer-routing:err Error: not found
  libp2p:peer-routing:err     at requirePeers (/usr/lib/node_modules/libp2p-daemon/node_modules/libp2p/src/content-routing/utils.js:65:19)
  libp2p:peer-routing:err     at processTicksAndRejections (node:internal/process/task_queues:96:5)
  libp2p:peer-routing:err     at async PeerRouting.getClosestPeers (/usr/lib/node_modules/libp2p-daemon/node_modules/libp2p/src/peer-routing.js:165:5)
  libp2p:peer-routing:err     at async drain (/usr/lib/node_modules/libp2p-daemon/node_modules/it-drain/index.js:12:20)
  libp2p:peer-routing:err     at async PeerRouting._findClosestPeersTask (/usr/lib/node_modules/libp2p-daemon/node_modules/libp2p/src/peer-routing.js:87:7)
  libp2p:peer-routing:err     at async _runPeriodically (/usr/lib/node_modules/libp2p-daemon/node_modules/set-delayed-interval/src/index.js:17:7)

This is caused by a call to requirePeers without specifying min, which defaults to 1. This is not a huge issue because the task runs periodically anyway, but the error log seems unwarranted for the situation.

The easiest way to reproduce the issue is to use the JS daemon directly, even if the issue seems unrelated to it.

npm install --global [email protected]
DEBUG=libp2p* jsp2pd --listen /ip4/127.0.0.1/tcp/2220 --hostAddrs /ip4/127.0.0.1/tcp/2222
# Wait for the error log
@odesenfans odesenfans added the need/triage Needs initial labeling and prioritization label Feb 20, 2022
@wemeetagain
Copy link
Member

@odesenfans can you confirm that this is still an issue in the latest version of libp2p?

@mpetrunic mpetrunic added need/author-input Needs input from the original author and removed need/triage Needs initial labeling and prioritization labels May 31, 2022
@BigLep
Copy link
Contributor

BigLep commented Jun 7, 2022

@odesenfans : closing for now since haven't received confirmation that it's an issue in the latest version. Feel free to reopen if it is.

@BigLep BigLep closed this as completed Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/author-input Needs input from the original author
Projects
None yet
Development

No branches or pull requests

4 participants