Skip to content
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

UDP Connected: Unhandled message SocketReceived #5318

Closed
jjmSE opened this issue Oct 14, 2021 · 2 comments · Fixed by #5412
Closed

UDP Connected: Unhandled message SocketReceived #5318

jjmSE opened this issue Oct 14, 2021 · 2 comments · Fixed by #5412

Comments

@jjmSE
Copy link

jjmSE commented Oct 14, 2021

Version Information
Version of Akka.NET? 1.4.25
Which Akka.NET Modules? Akka.IO

Describe the bug
When communication with the device is complete, we send a UdpConnected.Disconnect message to close the socket.
After that, we receive UdpConnected.Disconnected but we see an unhandled message in UdpConnection actor:

Message [SocketReceived] to [akka://dlmshe/system/IO-UDP-CONN/$a#267206278] was not delivered. [1] dead letters
encountered. If this is not an expected behavior then [akka://dlmshe/system/IO-UDP-CONN/$a#267206278] may have
terminated unexpectedly. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and
'akka.log-dead-letters-during-shutdown'.

Expected behavior
UDP socket is closed successfully.

Actual behavior
UDP socket is closed successfully but we see an unhandled message.

Environment
Windows
.NET Framework 4.8

DeadLetter
akka_seq_logs.csv

@Arkatufus
Copy link
Contributor

This is (almost) normal, the socket is read asynchronously, and a received message can be sent after the actor died, and since the actor already died, it will be sent to deadletter.
I said almost because this is actually undesireable behaviour because this is an absolute source of memory leak if DirectBufferPool is being used.
We'll be looking into this, its probable that the UDP actor need to be redesigned from the ground up to bulletproof it.

@jjmSE thank you for the report.

@Arkatufus
Copy link
Contributor

This is now trivial to fix after #5404 is merged in. We just need to add IDeadLetterSuppresion to SocketReceived.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants