Skip to content

Creating the Client is kind of slow #219

@dpc

Description

@dpc

The problem reported in #110 is still seem to be present on Pkarr v5.0.2 .

AFAICT mainline still does synchronous DNS resolution of 4 BitTorrent DHT bootstrap nodes during Rpc::new():

  router.bittorrent.com:6881
  dht.transmissionbt.com:6881
  dht.libtorrent.org:25401
  relay.pkarr.org:6881

which depending on your DNS setup can take up to few seconds sometimes.

  Call chain: pkarr::Client::build() → mainline::DhtBuilder::build() → Dht::new() → spawns thread,
   blocks on rx.recv() → Rpc::new() → to_socket_address(&DEFAULT_BOOTSTRAP_NODES) →
  s.to_socket_addrs() (blocking DNS).

The bootstrapping itself is offloaded to another thread , but the main thread is blocked on the rx.recv() in Dht::new making it effectively blocked and unsuitable to call in async code. At very least it's a papercut.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions