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

Fix serialize-messages for Akka.Cluster and Akka.Remote (netstandard2.0) #3791

Conversation

heatonmatthew
Copy link
Contributor

Applied changes from #3725 on top of netstandard 2.0 targeted upgrade with the serialization restriction of dotnet core projects lifted (#3790).

/// <param name="upNumber">The upNumber of the member, as assigned by the leader at the time the node joined the cluster.</param>
/// <param name="status">The status of this member.</param>
/// <param name="roles">The roles for this member. Can be empty.</param>
[JsonConstructor]
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't this serialized via protobuff ClusterMessageSerializer? Why json serialization?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zbynek001 A good question to ask. You're correct that there are a lot of protobuf encoded Cluster Messages (in ClusterMessages.g.cs), however this particular Member.cs class is actually being referenced in the messages defined under ClusterEvent.XYZ which are messages published to the EventBus (and in the context of the BugFix3724Spec test at least, are destined for the Event.LoggingBus).

I am new to the akka.net code base so take the following comments as very tentative:

@Aaronontheweb Do you have any input on this point?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So after a quick tour through the code, I think that the underlying Gossip and state management messages for the cluster do use the protobuf messages, but the observable messages published by the ClusterDomainEventPublisher on the EventBus are JSON serialized.

I'm interested to know if this is a specific design decision and/or if there would be resistance to migrating to a consistent protobuf wire format for both?

Copy link
Member

Choose a reason for hiding this comment

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

@zbynek001 @heatonmatthew so this might be an issue with serialize-messages inside Akka core where we don't use the correct serializer based on its manifest type.... I'm going to see if I can fix that in #3744 - I added a JsonConstructor call similar to this one for the Member class and that may no longer be necessary once the serialization fixes are added to serialize-messages in that PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Aaronontheweb let me know if there's anything specific you could do with a hand on. It's quite interesting code to be working on.

@Aaronontheweb
Copy link
Member

@heatonmatthew so I just merged in #3725 - but you have some additional code in this PR beyond my changes. What's the best way to reconcile this?

@heatonmatthew
Copy link
Contributor Author

@Aaronontheweb this one builds on my changes from #3790 which is waiting to be merged. The majority of the extra changes will be from that, so it would be helpful to progress that one first. I've just updated that branch now.

Once #3790 is merged, I can review this against the combined set of changes. Since this whole branch is intended to be a cherry-pick of #3724 on top of #3790 (mainly so that I can use it in pre-production for myself), there might be nothing more to do with this specific task.

@Aaronontheweb
Copy link
Member

Aaronontheweb commented Feb 27, 2020

Not needed - this is already fixed.

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

Successfully merging this pull request may close these issues.

None yet

4 participants