Open emliunix opened 4 years ago
I think that's simply because the old session hasn't terminated in the first place. The session blocks at receiving next TCP message while the remote already exited.
And my CPU fan indicates the blocking must be some kind of loop.
Seems it's still related to UdpSocket. After first UDP error, which is udp recv error, the CPU goes up to 100%. Inspect with a debugger shows it's stalled in UdpSocket::recv.
So the weired part is:
Maybe I can write a more clean code with only the UDP part to reproduce this issue.
And maybe I can stick to the principle that UDP receive error is unrecoverable.
Sticking to the principle makes the program running normally. At least no CPU 100% in low-level code.
And now I need to figure out ways to manage my UDP connection. The problems are:
It's guaranteed that UdpSocket will release the resources when dropped. Eg. FileDesc::Drop() on unix platforms.
In my case, however, it's not dropped. I guess it's still kept somewhere in the async engine.
how UdpSocket guaranteed to close on unix
The hierarchy is like: