-
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.Router: sending a message to a remote actor via IScheduledTellMsg
results in serialization error
#7247
Comments
…-ActorCell'd routees
IScheduledTellMsg
results in serialization errorIScheduledTellMsg
results in serialization error
As it turns out, this was not an issue with Akka.Remote or with the scheduler at all - but rather it was really an issue with routers in Akka.NET. The key actor in the reproduction was a router. We've had measures in-place to prevent akka.net/src/core/Akka/Actor/Scheduler/HashedWheelTimerScheduler.cs Lines 557 to 566 in 260aee9
That code would detect a However, as it turns out - we do send akka.net/src/core/Akka/Routing/RoutedActorCell.cs Lines 191 to 197 in 260aee9
That's what we need to fix |
Version Information
Version of Akka.NET? v1.5.13 and higher
Which Akka.NET Modules? Akka.Remote
Describe the bug
This bug was introduced in Akka.NET v1.5.13 via #6461
Repro from our Discord - imagine you have the following code:
Imagine if the
_receiverActor
is aRemoteActorRef
- this will cause theTick
message to be wrapped inside aScheduledTellMsg
akka.net/src/core/Akka/Actor/Scheduler/IScheduledTellMsg.cs
Lines 27 to 34 in a14bb84
Now this might not normally be a problem for many serializers - Newtonsoft.Json can probably handle this just fine. But it completely disrupts custom serialization and prevents it from working correctly.
We added
ScheduledTellMsg
in order to make it easier for libraries like Phobos in order to stop us from tracing scheduled messages, since that's almost always useless noise.Expected behavior
ScheduledTellMsg
is supposed to be automatically unpacked by theActorCell
- therefore it should never be something that pops into user-space.Actual behavior
However,
RemoteActorRef
s do not have anActorCell
! Therefore the message never gets unpacked and will, instead, be serialized and transmitted over the network. This is a bug - we probably need to just unpack the underlying message and send that sans theScheduledTellMsg
envelope.The text was updated successfully, but these errors were encountered: