fix(actors): preserve Proto.Actor remote config descriptor registration - #171
sfmskywalker merged 3 commits into
Conversation
Register StartClusterMember with priority -100 and add regression coverage for hosted-service ordering. Fixes elsa-workflows#167
Reuse the RemoteConfig attached to the ActorSystem when registering virtual actor protobuf descriptors. Add regression coverage for factory invocation count and descriptor registration.
|
Review note: This PR is stacked on #168. View only the changes introduced for #170. The focused diff contains one production file and one regression-test file. |
Greptile SummaryThis change builds the Proto.Actor remote configuration once, registers virtual-actor protobuf descriptors on that configuration, and attaches it to the actor system. It also adds focused regression tests and includes the test project in the solution. Cluster startup is now registered before MongoDB serializer initialization. Because the actor cluster can begin accepting work before the serializers are installed, persistence operations arriving during application startup can fail or serialize actor values incorrectly. T-Rex validation blockedThe focused runtime validation could not execute because the required Confidence Score: 4/5Do not merge until cluster availability is ordered after persistence serializer initialization. The checked source paths show that cluster startup is registered at Files Needing Attention:
What T-Rex did
Prompt To Fix All With AI### Issue 1
src/modules/actors/Elsa.Actors.ProtoActor/Features/ProtoActorFeature.cs:94
**Cluster starts before persistence initialization**
Registering `StartClusterMember` at `-100` starts and exposes the actor cluster before MongoDB's `ConfigureMongoDbSerializers` hosted service, which remains at `-10`. Actor work received in that window can reach persistence before its serializers are registered, causing startup-time persistence failures or incorrect serialization. Keep the cluster at the default hosted-service priority, or otherwise ensure it starts after persistence initialization.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Fix Proto.Actor remote config descriptor..." | Re-trigger Greptile |
|
PR author is not in the allowed authors list. |
sfmskywalker
left a comment
There was a problem hiding this comment.
Maintainer review of ae9e2388324fc743f38f6db7459aa430645b7f42: approved. I reviewed the focused diff against current main across correctness, readability, architecture, security, and performance. The RemoteConfig instance is now created once, receives descriptors, and is attached to the ActorSystem; the lifecycle-ordering review finding is corrected with -10 < -5 < -1 regression coverage. Local validation passes 6/6 tests, multi-target module builds, and diff checks. No actionable findings remain.
Summary
Ensure virtual-actor protobuf descriptors are registered on the same
RemoteConfiginstance that is attached to theActorSystem.Fixes #170.
Changes
AddVirtualActors.RemoteConfigtogether withClusterConfig.WithRemote.-5, after MongoDB serializer initialization at-10and before tenant/cluster-dependent services at-1.-10 < cluster < -1lifecycle order.Reproduction and verification
Before the fix, resolving
ActorSystemwith a factory returning a freshRemoteConfigcreates two configurations: the first is attached, while the second receives the protobuf descriptors. Serialization through the attached configuration then fails because its registry lacks the descriptor.The focused regression tests were confirmed to fail against the previous implementation through the duplicate invocation count and missing attached serializer.
Current-head validation:
ProtoActorRemoteConfigTests: 2 passed.Elsa.Actors.ProtoActor.UnitTestsproject: 6 passed, 0 failed.Elsa.Actors.ProtoActorRelease builds for .NET 8, 9, and 10: succeeded with zero errors and two existing XML-documentation warnings.git diff --check origin/main...HEAD: passed.Review finding addressed
Greptile correctly identified that the inherited
-100cluster priority preceded MongoDB serializer initialization at-10. The updated-5priority preserves #167's required order before tenant activation and ordinary dependent services while removing that startup window. The review thread has been answered directly and resolved after the fix.Scope
This PR remains focused on
RemoteConfigconstruction, virtual-actor descriptor registration, the required hosted-service ordering correction, and regression coverage. It does not change public APIs, add dependencies, or change the documented sequential-host lifecycle assumption.