py-evm: Trinity logs lots of "socket.send() raised exception" warnings

on current master @ 32cc41d5315003289b1c86b31680f2501894da06

What is wrong?

When running trinity a lot of these warnings happen.

 WARNING  07-14 03:48:12  selector_events  socket.send() raised exception.
 WARNING  07-14 03:48:12  selector_events  socket.send() raised exception.
 WARNING  07-14 03:48:12  selector_events  socket.send() raised exception.
 WARNING  07-14 03:48:12  selector_events  socket.send() raised exception.
 WARNING  07-14 03:48:12  selector_events  socket.send() raised exception.
 WARNING  07-14 03:48:12  selector_events  socket.send() raised exception.
 WARNING  07-14 03:48:12  selector_events  socket.send() raised exception.
 WARNING  07-14 03:48:12  selector_events  socket.send() raised exception.
 WARNING  07-14 03:48:12  selector_events  socket.send() raised exception.

How can it be fixed

It looks like it may related to this issue found here on stack overflow:

https://stackoverflow.com/questions/32175217/how-to-detect-write-failure-in-asyncio

However, brief experimentation with adding a await asyncio.sleep(0) to the only place in our code that calls writer.drain() didn’t fix anything…

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@carver

The transaction pool could use the new pool subscriber API from #1009 then: https://github.com/ethereum/py-evm/pull/1009/files#diff-0c5a90ea9349bdb0b8d152d6c4b24583R694 (after it’s merged)

I think this is part of the solution, however, I believe what we’re seeing is a race condition where the peer is connected at the start of the tx pool send loop, but by the time that it comes time to send to that peer they have disconnected.