Update ResilientFunctions to the CreateAndStart lifecycle and fix wrapper suspension - #13
Merged
Merged
Conversation
…lows wrapper The submodule moves to latest main (PR #221), where FunctionsRegistry's constructor is private and the static CreateAndStart factories are the only public construction path - guaranteeing background processing never starts before construction completes. FlowsContainer follows the same shape: private constructor plus async CreateAndStart factories (the Create helper is renamed accordingly). The DI registration resolves the container through a factory that blocks once during host start-up, mirroring the old constructor's synchronous replica-watchdog initialization. Adaptations to the intervening core changes: - Flows<...> now registers through the public Register* overloads with plain Task-returning inners. The previous internal-overload registration bypassed the core's WithSuspension wrapper, and since the central-suspension redesign (core #204) removed exception-based suspension, wrapper flows awaiting a message were stuck Executing forever instead of suspending. The wrapper's own exception-to-result catch blocks are deleted - the core adapter owns that conversion now. - SuspendInvocationException catches removed (type deleted; suspension no longer surfaces as an exception). - FlowOptions/FlowsContainer no longer reference the removed EnableWatchdogs and DelayStartup settings; MapToLocalSettings matches the new LocalSettings shape. - Flows.Interrupt removed, mirroring the interrupt API deletion in the core. - OptionsTests appends its message via the registration MessageWriter instead of the control panel - control-panel appends against a live flow race the owner's effect-version guard.
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.
Submodule update
Moves the ResilientFunctions submodule to latest main (
5491be3b), which includes PR #221:FunctionsRegistry's constructor is private and the staticCreateAndStartfactories are the only public construction path, so background processing (cluster membership, message delivery, crash/postponed recovery) never runs before registration setup completes.FlowsContainer follows the same shape
CreateAndStartfactories (Createrenamed accordingly; parameter names preserved for named-argument callers).new FlowsContainer(...)/FlowsContainer.Create(...)call sites across tests, samples and service buses migrated.Bug fix: wrapper flows could never suspend
Flows<...>registered through the internalRegister*overloads takingFunc<..., Task<Result<T>>>. Those overloads register the inner as-is - only the public overloads wrap the body inWithSuspension, the race that produces Suspend/Postpone results since the core's central-suspension redesign (core #204). The wrapper'scatch (SuspendInvocationException)blocks compensated for exception-based suspension that no longer exists, so any wrapper flow awaiting a message satExecutingforever - no exception, no warning.Minimal repro (same flow body, one line difference):
Fix: the wrapper registers plain
Task-returning inners through the public overloads and its hand-rolled exception-to-result catch blocks are deleted - the core adapter owns suspension racing and exception conversion.Other core-drift adaptations
FlowOptions/FlowsContainerno longer reference the removedEnableWatchdogs/DelayStartupsettings;MapToLocalSettingsmatches the newLocalSettingsshape.Flows.Interruptremoved, mirroring the interrupt-API deletion in the push-only core.SuspendInvocationExceptionusages removed (type deleted in core).OptionsTestsappends its message via the registrationMessageWriterinstead of the control panel - control-panel appends against a live flow race the owner's effect-version guard.Testing
Cleipnir.Tests: 25/25 passed.Cleipnir.Tests.AspNet: 8/8 passed.🤖 Generated with Claude Code