Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

AlreadyWaiting exception during initial discovery. #762

@pipermerriam

Description

@pipermerriam

What is wrong?

   ERROR  05-23 16:16:10  base_events  Task exception was never retrieved
future: <Task finished coro=<PeerPool.lookup_random_node() done, defined at /Users/piper/sites/py-evm/p2p/peer.py:741> exception=AlreadyWaiting("There's another coroutine waiting for a neighbours packet from <Node(0x9124@148.251.19.50)>",)>
Traceback (most recent call last):
  File "/Users/piper/sites/py-evm/p2p/peer.py", line 745, in lookup_random_node
    await self.discovery.lookup_random(self.cancel_token)
  File "/Users/piper/sites/py-evm/p2p/discovery.py", line 93, in lookup_random
    return await self.kademlia.lookup_random(self.cancel_token.chain(cancel_token))
  File "/Users/piper/sites/py-evm/p2p/kademlia.py", line 575, in lookup_random
    return await self.lookup(random.randint(0, k_max_node_id), cancel_token)
  File "/Users/piper/sites/py-evm/p2p/kademlia.py", line 565, in lookup
    *[_find_node(node_id, n) for n in nodes_to_ask])
  File "/Users/piper/sites/py-evm/p2p/kademlia.py", line 541, in _find_node
    candidates = await self.wait_neighbours(remote, cancel_token)
  File "/Users/piper/sites/py-evm/p2p/kademlia.py", line 461, in wait_neighbours
    "There's another coroutine waiting for a neighbours packet from {}".format(remote))
p2p.kademlia.AlreadyWaiting: There's another coroutine waiting for a neighbours packet from <Node(0x9124@148.251.19.50)>

looks like a race condition of some kind which results in stacktrace being dumped to terminal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions