Repository navigation
AOT: module serializer table for Akka.Cluster (#8626, part 3a) - #8666
Merged
Aaronontheweb merged 4 commits intoSep 30, 2026
Merged
Aaronontheweb merged 4 commits into
Aaronontheweb merged 4 commits into
Conversation
Adds ClusterSerializers, covering Cluster.conf's two serializers (ClusterMessageSerializer, ReliableDeliverySerializer) and their three bound types, to core's module map. Both classes have a single (system) constructor and neither has a serialization-settings block in Cluster.conf, so the factory calls that constructor directly for each.
…cluster-serializers # Conflicts: # BREAKING_CHANGES_V1.6.md
This was referenced Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 3a of #8626. Follows #8658's module-table pattern for
Akka.Cluster, the core cluster assembly. Tools, Sharding, DistributedData and Metrics follow in a companion PR (part 3b) to keep each PR reviewable; the two touch the same block ofModuleSerializerTable.Defaultand will conflict trivially on merge.Changes
ClusterSerializers(Akka.Cluster.Serialization) is Cluster's firstModuleSerializerstable. It covers everyserializersandserialization-bindingsrow in Cluster.conf:ClusterMessageSerializer(id 5) andReliableDeliverySerializer(id 36, aliasreliable-delivery)."Akka.Cluster", passing a type-name literal toLoad.IDeliverySerializable(Akka.Delivery.Internal) lives inAkka.dll, notAkka.Cluster.dll, but Cluster.conf binds it toreliable-delivery. It's listed inClusterSerializers.BoundTypesand resolves the same way Remote'sSystem.Stringbinding does: through the "modules this config loaded" lookup, not the module's own assembly.Constructor choices
Both classes have exactly one constructor, and Cluster.conf has no
serialization-settingsblock for either alias, so the factory calls the class's only constructor directly:akka-cluster(system)reliable-delivery(system)No public API changes. No IVT changes: Akka already grants Akka.Cluster and Akka.Cluster.Tests access to its internals, and
IDeliverySerializableis public.Behavior with the switch on (recorded in BREAKING_CHANGES_V1.6.md)
Same shape as #8658, measured against this module specifically:
serialization-settings.<alias>block for either serializer now builds it instead of throwingMissingMethodException, since neither constructor takes aConfig.TargetInvocationException.IDeliverySerializable's binding -- now resolve instead of throwingConfigurationException.A versioned name for a different Akka.Cluster version resolves both ways; reflection already accepted one.
Tests
ClusterSerializersSpec(Akka.Cluster.Tests) runs in aDynamicTypeLoadingCollection(non-parallel) and derives fromAkkaSpecwithITestOutputHelper, reusingModuleSerializerSpecs(Akka.Tests.Shared.Internals.Xunit3) for the shared checks:AssertTableMatchesConfig-- the table'sSerializers/BoundTypesname exactly the types Cluster.conf's rows name.AssertHostingSpellingResolves-- every row, respelled as anAssemblyQualifiedName, still resolves with the switch off.AssertBuildsWithoutWarning-- builds without a warning; ids 5 and 36 map to the right classes.Identifier, for every bound sample (ClusterHeartbeatSender.Heartbeat,ClusterRouterPool,ConsumerController.Delivery<int>).IDeliverySerializable = bytes) takes effect and leaves the other alias alone.All 5 facts pass on 3 repeated runs.
Mutation checks (done locally, reverted before this PR)
ClusterRouterPoolfromBoundTypesfails the table-matches-config check (and, since it also breaks resolution for every type, several other facts).typeof(string)) fails the reverse direction of the table-matches-config check.Validation
dotnet build -c Release -warnaserror: Akka, Akka.Cluster, Akka.Cluster.Tests -- 0 warnings.ClusterSerializersSpecpasses on 3 repeated runs.dotnet test src/core/Akka.Tests -c Release -f net10.0 --filter "FullyQualifiedName~Serialization": 128 passed.Akka.API.Tests: 23 passed, no API changes.