orleans: Failsafe Exception Serialization
We currently rely on all serialized types to be present during deserialization. This means that the assembly for any type transferred over the wire must be present on the receiving end. This is fine for most cases, but can be tricky for ‘unexpected’ types, such as exceptions.
Users would like to be able to see basic information about which exceptions are being thrown and from where, even if they are unable to deserialize the concrete exception. We can accomplish this using the ILBasedSerializer
, adopting a special scheme for serializing Exceptions whereby base class fields are serialized first, like so:
<FullTypeName><Length><ExceptionBaseClassFields><RemainingFields>
Using this scheme, we can fall back to deserializing into Exception
or an OrleansFallbackException
class and retain the original Message
and StackTrace
properties along with the name of the original exception type.
I’ve prototyped this and added a test case. I can make it PR ready.
Thoughts? Should I pursue this?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 2
- Comments: 18 (16 by maintainers)
Commits related to this issue
- Enable relay of un-[Serializable] exceptions. Orleans 1.3.* used the Binary Format Serializer from .NET proper. With the move to .NET Core and the .NET Standard Library, more of the packages we depen... — committed to realartists/shiphub-server by kogir 7 years ago
- Failsafe Exception serialization (#2310) — committed to ReubenBond/orleans by ReubenBond 8 years ago
- Failsafe Exception serialization (#2310) (#2633) * Failsafe Exception serialization (#2310) * Review feedback 1 * Review feedback 2 — committed to dotnet/orleans by ReubenBond 7 years ago
Since I’m currently encountering the exact scenario described in this issue (see #2528), please let me know if there’s anything I can do help. I’d be happy to dig in and polish up the prototype implementation with a little guidance.
In the meantime, adopting the new
ILBasedSerializer
and merging the silo and client bin directories is enough, so no rush or anything.Lol, nice. BTW, let’s override the ToString method so that it uses the original type name, and basically prints similar to the real deal and not like this proxy exception