-
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
Remoting and an exception as a payload message #3903
Comments
Related: #3811 |
Agree that this is a real issue that needs addressing. Slated it for the v1.4.0 release. |
So I stumbled on this issue because of a problem I encountered when trying to return a Status.Failure with an exception from a remote actor. After some investigation I found that Newtonsoft is quite capable of serializing and deserializing an exception on it's own...but somewhere in Akka some value properties on an Exception are treated as an object. Akka produces I don't recognize the json produced by Akka, is this some special value type setting that is used by Akka when sending and not understood when the receiving side tries to deserialize it? |
Looks like this bit of code is causing havoc on exception (de)serialization. Any way to bypass it for exceptions? |
Looking into this per @Zetanova 's comments on #6294 (comment) It looks like we already have remote akka.net/src/core/Akka.Remote/Serialization/ExceptionSupport.cs Lines 21 to 155 in 1b96294
I'll check the test suite to see if we have tests covering this scenario for remote deployments. We'll also add support for |
* added end to end spec to validate error serialization for remote actor supervision * defined `.proto`s for `Status.Failure` and `Status.Success` * added `Status.,Failure` and `Status.Success` support to the `MiscMessageSerializer` * added tests to `MiscMessageSerializerSpec` * close #3903
) * added end to end spec to validate error serialization for remote actor supervision * defined `.proto`s for `Status.Failure` and `Status.Success` * added `Status.,Failure` and `Status.Success` support to the `MiscMessageSerializer` * added tests to `MiscMessageSerializerSpec` * close akkadotnet#3903 (cherry picked from commit 998dcca)
* added end to end spec to validate error serialization for remote actor supervision * defined `.proto`s for `Status.Failure` and `Status.Success` * added `Status.,Failure` and `Status.Success` support to the `MiscMessageSerializer` * added tests to `MiscMessageSerializerSpec` * close #3903 (cherry picked from commit 998dcca) Co-authored-by: Aaron Stannard <aaron@petabridge.com>
Akka.Remoting and Akka.Cluster implement a transparent IPC system.
The supervisor system is relying on exception types as it's message protocol.
This works fine in a single system but with combination of remote-deploy
it leads to problems.
Because not all exceptions and there fields are serializable
and/or the exception-type is known to every cluster node,
so the exception as a message can't be always transmitted.
And it is not known for the sender or receiver what Exception-Types
will be generated or can be handled.
To resolve this conflict, i see following options:
Option A
To transform every exception handled by the supervisor-strategy
to an well-known generic "ErrorMessage" and/or "ReasonMessage"
and add an Extension method to transform an ErrorMessage
back to an exception in user code.
This acts as a substitution, the exception-reference itself
can be held internally, but will not be serialized.
With this default implementation the PostRestart(Exception error) is still be called
and nothing should breaks.
Option B
Akka.Remoting is treating an exception as a special-message.
Then on the receiving side, it will only try to deserialize it back.
If it fails, then it will generate a GenericException instead.
The text was updated successfully, but these errors were encountered: