Open PPakalns opened 1 month ago
Hi, thanks for bringing this issue to light!
Yes, if the way of unlocking the receiver queue is in the same thread as this sender, then it will cause 100% of the CPU without the possibility of unlocking it. That should definitely be fixed using a POLLIN
Workaround implementation of AsyncFrameAdapter: https://github.com/lemunozm/message-io/compare/master...PPakalns:message-io:async_framed_tcp
Of course, this adds additional cost of storing queue of buffers to be sent over the network.
Great! Feel free to open a PR with this new adapter. It can be interesting for users using tcp
as you.
As seen in TODO comment and behaviour on io::ErrorKind::WouldBlock.
In server case this blocks communication with other clients.
I stumbled upon a situation when a faulty virtual network tunnel doesn't process sent data and whole program gets stuck in this loop and has 100% CPU utilization. It causes issues and delays in other situations too with large messages.
https://github.com/lemunozm/message-io/blob/master/src/adapters/tcp.rs#L187