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

IO-TCP logs unnecessary error message on flow termination #6931

Open
anpin opened this issue Sep 27, 2023 · 1 comment
Open

IO-TCP logs unnecessary error message on flow termination #6931

anpin opened this issue Sep 27, 2023 · 1 comment

Comments

@anpin
Copy link

anpin commented Sep 27, 2023

Version Information
Version of Akka.NET? 1.5.13
Which Akka.NET Modules? Akka and Akka.Streams

On net472 target TcpStreams extensions logs out unnecessary error message when attached TCP flow is terminated. The message is not produced when target runs net7.0.

[ERROR][09/27/2023 13:15:59.865Z][Thread 0035][akka://my-system/system/IO-TCP/$a] Monitored actor [[akka://my-system/user/$a/StreamSupervisor-1/$$a#549811830]] terminated
Cause: Akka.Actor.DeathPactException: Monitored actor [[akka://my-system/user/$a/StreamSupervisor-1/$$a#549811830]] terminated
  at Akka.Actor.ActorBase.Unhandled (System.Object message) [0x00015] in <d180930ef5f34340b9af3303aa68102d>:0 
  at Akka.Actor.ActorBase.AroundReceive (Akka.Actor.Receive receive, System.Object message) [0x00096] in <d180930ef5f34340b9af3303aa68102d>:0 
  at Akka.Actor.ActorCell.ReceiveMessage (System.Object message) [0x00023] in <d180930ef5f34340b9af3303aa68102d>:0 
  at Akka.Actor.ActorCell.ReceivedTerminated (Akka.Actor.Terminated t) [0x00042] in <d180930ef5f34340b9af3303aa68102d>:0 
  at Akka.Actor.ActorCell.AutoReceiveMessage (Akka.Actor.Envelope envelope) [0x000af] in <d180930ef5f34340b9af3303aa68102d>:0 
  at Akka.Actor.ActorCell.Invoke (Akka.Actor.Envelope envelope) [0x0006d] in <d180930ef5f34340b9af3303aa68102d>:0 

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/anpin/akka-mergehub-and-socket-repro
  2. cd akka-mergehub-and-socket-repro/ConsoleApp1
  3. dotnet run --framework net472
  4. depending on the random condition inside the loop the server might terminate with exception, regardless of it press Ctrl-C to close the app and observe the above exception
  5. Run the same example with dotnet run --framework net7.0 and see no error after Ctrl-C

Note: the exception inside the server code was planted to illustrate another error message logged when MergeHub source is failing

Expected behavior
The Monitored actor terminated message is not emitted on both platforms

Actual behavior
The Monitored actor terminated message is emitted on net472, but not on dotnet

Environment
Both Linux and Windows

.NET SDK:
Version: 7.0.400
Commit: 73bf45718d

anpin added a commit to anpin/akka-mergehub-and-socket-repro that referenced this issue Sep 27, 2023
the net472 version reproduces the issue akkadotnet/akka.net#6931
@Aaronontheweb
Copy link
Member

This is definitely a long-standing bug with Akka.IO - we're using a very sloppy technique for ensuring the mutual destruction of actors inside of here, hence the useless spam in the error logs. We should handle this more appropriately so it doesn't cast off unnecessary exceptions.

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

No branches or pull requests

2 participants