-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Akka.IO.UdpExt.Manager: OverflowException when sending UDP packets to terminated clients #4641
Comments
According to RFC1122 this seems to be by design: https://tools.ietf.org/html/rfc1122#page-78
If i had to guess i would assume the Akka.Net UDP implementation is reading ICMP errors as udp messages and that is why I got random buffer issues. So the Akka.Net UDP implementation should be aware of this. |
Looking at the code from akka.net/src/core/Akka/IO/UdpListener.cs Line 117 in 0948525
|
Ignoring System.Net.SocketError.ConnectionReset (WSAECONNRESET 10054) is equal to java.net.PortUnreachableException.
Ignoring System.Net.SocketError.ConnectionReset (WSAECONNRESET 10054) is equal to java.net.PortUnreachableException.
Ignoring System.Net.SocketError.ConnectionReset (WSAECONNRESET 10054 / java.net.PortUnreachableException).
closed via #4643 - going to roll this into Akka.NET v1.4.13 |
Akka.Net Version: v1.4.8
Platform: .NET core 3.1 (windows)
Summary:
The UDP actor is sometimes crashing when sending data to UDP clients which already have been terminated.
Sometimes this is followed by an
OverflowException
. Sometimes by anArgumentException
. Sometimes I receive empty messages from the UDP actor.Analysis:
While the error occured, I recorded the udp traffic with wire shark.
The exception is occuring when the server tries to send a UDP packet to a non existing client and then receives an ICMP response "Destination unreachable (Port unreachable)" (Type:3, Code:3). And according to the wire shark trace there was no inbound traffic except the ICMP port unreachable packet. The empty messages I received from the UDP actor are also matching timestamps from the ICMP port unreachable packets.
Hint: The original UDP message itself is included within the ICMP response to the server.
I am not sure if this is really causing the issue and I know this is far from obvious, but according to the call stack (see exceptions below) and the empty messages received - for whatever reason the listener on the port seems to react to the ICMP unreachable packets including the original UDP packets. Interestingly wire shark does something similar: It's showing the associated ICMP unreachable packets even though I filtered "udp and udp.port == 6666".
Reproduction:
5.1 (Wait for an ICMP port unreachable packet)
Expected:
UDP actor is not crashing.
Actual:
UDP actor is crashing sporadically.
ArgumentException:
OverflowException:
After this the port is occupied:
[ERROR][27.11.2020 21:57:52][Thread 0036][akka.tcp://SYSTEMNAME@0.0.0.0:7778/system/IO-UDP-FF/$a] Failed to bind UDP channel to endpoint [0.0.0.0:7777]
I haven't had the chance to debug it yet but I think the implementation should be more resilient against these scenario, so no one can bring it down.
Thanks in advance and best regards
Thomas
The text was updated successfully, but these errors were encountered: