Skip to content

Conversation

Aaronontheweb
Copy link
Member

This PR swaps out the underlying Wire dependencies for Hyperion, in order to stop our users from getting GPL'd by upgrading to a new version of Wire.

I propose doing this across two releases

  1. Release the current Akka.Serailization.Wire, complete with Hyperion dependencies, to move net new users onto the latest Hyperion version.
  2. Deprecate the Akka.Serialization.Wire package and replace it with a Akka.Serialization.Hyperion package and update the necessary documentation in a subsequent release.

Any thoughts on the above?

@@ -186,7 +186,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.Serialization.Wire", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.Serialization.TestKit", "contrib\serializers\Akka.Serialization.TestKit\Akka.Serialization.TestKit.csproj", "{CAA97041-CFC0-4081-9BD2-8B139E62A611}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.Serialization.WireTests", "contrib\serializers\Akka.Serialization.WireTests\Akka.Serialization.WireTests.csproj", "{402FA351-D6C6-40FD-8868-F07156035919}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.Serialization.Wire.Tests", "contrib\serializers\Akka.Serialization.WireTests\Akka.Serialization.Wire.Tests.csproj", "{402FA351-D6C6-40FD-8868-F07156035919}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed the project so it would get picked up by our FAKE script for serialization purposes.

@@ -165,7 +165,7 @@ private void WarnIfJsonIsDefaultSerializer()
Serialization.FindSerializerForType(typeof (object)) is NewtonSoftJsonSerializer)
{
Log.Warning($"NewtonSoftJsonSerializer has been detected as a default serializer. " +
$"It will be obsoleted in Akka.NET starting from version 1.5 in the favor of Wire " +
$"It will be obsoleted in Akka.NET starting from version 1.5 in the favor of Hyperion " +
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the message in our warning message, but we haven't updated the documentation that it points to currently.

@sean-gilliam
Copy link
Member

Sounds good to me

@Aaronontheweb
Copy link
Member Author

cc @Horusiath looks like we have an issue with the Akka.DistributedData bindings and the Hyperion serializer. Anything special that needs to be done with Hyperion or its serializer definition here? Take a look at the unit test failures. I can get them to fail locally as well.

@Horusiath
Copy link
Contributor

@Aaronontheweb I think this is a result of changes made between Wire v0.7.1 and v0.8.1 - existing Akka.Serialization.Wire references the first, while Hyperion is based on the second.

It's one of the edge cases, we didn't have a test for - situation when immutable collection is referenced through interface (in this case IImmutableDictionary<,>) as a field in some custom class. I'll try to fix it today.

@Aaronontheweb
Copy link
Member Author

@Horusiath thanks, we'll update the Hyperion package today

@Aaronontheweb
Copy link
Member Author

Resolves #2435 as well

@Horusiath
Copy link
Contributor

Horusiath commented Jan 3, 2017

Failures in ddata are caused by the problem I've solved in akkadotnet/Hyperion#13 . Not sure if that fix is not a part of the latest Hyperion version.

@Aaronontheweb
Copy link
Member Author

@Horusiath yep, that's all in there. Newest version of Hyperion is going up on NuGet now.

@Aaronontheweb
Copy link
Member Author

Upgraded to 0.9.1

@Aaronontheweb
Copy link
Member Author

@Horusiath still have 7 spec failures on the DistributedData stuff, down from 9. http://petabridge-ci.cloudapp.net/viewLog.html?buildId=18997&buildTypeId=AkkaNet_AkkaNetLinuxMonoUnitTests&guest=1

@Horusiath
Copy link
Contributor

Horusiath commented Jan 4, 2017

@Aaronontheweb I've pulled your PR and tracked down the issue. The problem lies here.

To deserialize enumerables (which ddata collections actually are), existing serializer was trying to find either AddRange or Add method and invoke it. Problem is that it automatically assumes, that signature of add method follows the rules:

  • void Add(T item)
  • void AddRange(IEnumerable<T> items)

...which is not true in case of ddata i.e. GSet<>.Add returns a whole new GSet instance (that's why test fails on assertion), while LWWDictionary<>.Add has different input params (that's why we have reflection exception).

@Aaronontheweb
Copy link
Member Author

Found the issue:

[Test collection for Akka.Serialization.Wire.Tests.WireTests (1)] Akka.Serialization.Wire.Tests.WireTests.CanSerializeProps (4s)
[16:37:30]W:		 [docker] Stacktrace:
[16:37:30]W:		 [docker] 
[16:37:30]W:		 [docker]   at <unknown> <0xffffffff>
[16:37:30]W:		 [docker]   at (wrapper managed-to-native) System.RuntimeTypeHandle.type_is_assignable_from (System.Type,System.Type) <0x00057>
[16:37:30]W:		 [docker]   at System.RuntimeTypeHandle.CanCastTo (System.RuntimeType,System.RuntimeType) <0x00020>
[16:37:30]W:		 [docker]   at System.RuntimeType.IsAssignableFrom (System.Type) <0x000b6>
[16:37:30]W:		 [docker]   at Akka.Actor.Props.CreateProducer (System.Type,object[]) <0x0005d>
[16:37:30]W:		 [docker]   at Akka.Actor.Props..ctor (Akka.Actor.Deploy,System.Type,object[]) <0x00087>
[16:37:30]W:		 [docker]   at Akka.Actor.Props/PropsSurrogate.FromSurrogate (Akka.Actor.ActorSystem) <0x0005b>
[16:37:30]W:		 [docker]   at Akka.Serialization.WireSerializer/<WireSerializer>c__AnonStorey0.<>m__1 (Akka.Util.ISurrogate) <0x00025>
[16:37:30]W:		 [docker]   at Hyperion.Surrogate`2/<>c__DisplayClass0_0<TSource_REF, TSurrogate_REF>.<.ctor>b__1 (object) <0x00053>
[16:37:30]W:		 [docker]   at Hyperion.ValueSerializers.FromSurrogateSerializer.ReadValue (System.IO.Stream,Hyperion.DeserializerSession) <0x0003d>
[16:37:30]W:		 [docker]   at Hyperion.Serializer.Deserialize<T_REF> (System.IO.Stream) <0x00044>
[16:37:30]W:		 [docker]   at Akka.Serialization.WireSerializer.FromBinary (byte[],System.Type) <0x00063>
[16:37:30]W:		 [docker]   at Akka.Tests.Serialization.AkkaSerializationSpec.AssertEqual<T_REF> (T_REF) <0x0006d>
[16:37:30]W:		 [docker]   at Akka.Tests.Serialization.AkkaSerializationSpec.CanSerializeProps () <0x00077>
[16:37:30]W:		 [docker]   at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <0x000c8>
[16:37:30]W:		 [docker]   at <unknown> <0xffffffff>
[16:37:30]W:		 [docker]   at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <0x0006c>
[16:37:30]W:		 [docker]   at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x000b7>
[16:37:30]W:		 [docker]   at System.Reflection.MethodBase.Invoke (object,object[]) <0x0002a>
[16:37:30]W:		 [docker]   at Xunit.Sdk.TestInvoker`1<TTestCase_REF>.CallTestMethod (object) <0x00043>

Looks like there's something going on in that assertion specifically that triggers a native error in the Mono runtime. Working on resolving some Mono build issues with Hyperion itself so I can get a better look.

@Aaronontheweb
Copy link
Member Author

Trying this out with a Mono 4.6.1 build

@Aaronontheweb
Copy link
Member Author

Looks like the Mono upgrade fixed the serialization issue.

@Horusiath
Copy link
Contributor

Is it ready to merge?

@Aaronontheweb
Copy link
Member Author

Aaronontheweb commented Jan 14, 2017 via email

@Horusiath Horusiath merged commit 1963573 into akkadotnet:dev Jan 14, 2017
@Aaronontheweb Aaronontheweb modified the milestone: 1.1.3 Jan 20, 2017
@Aaronontheweb Aaronontheweb deleted the hyperion branch June 6, 2024 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants