Deserialize effects once at the invocation boundary - #257
Open
stidsborg wants to merge 2 commits into
Open
Conversation
The record had no live consumers: its only producer - the PostgreSQL SqlGenerator's ReadStoredFunction - was itself uncalled, and ToStoredFlow had no callers either. Delete both.
EffectResults now takes already-deserialized effects (DeserializedEffect): InvocationHelper.CreateEffect (now async) deserializes the fetched StoredEffects up front, and PendingEffectChange carries the object-form read view alongside the serialized write payload (the latter only while dirty). The read path - TryGet (now sync), CreateOrGet and InnerCapture replay - is cast-only: no serializer or type-store resolution on reads. Also deletes the unused raw StoredEffect accessors on Effect (GetStoredEffect/FlushlessSet) and reduces EffectResults.Set to the payload-less completion marker Mark needs.
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.
Summary
EffectResultsnow takes a list of already-deserialized effects (DeserializedEffect):InvocationHelper.CreateEffect(now async) deserializes the fetchedStoredEffects up front via a newStoredEffect.Deserialize(serializer, typeMapper)extension.PendingEffectChangecarries both forms:Effect— the object-form read view (always present except for deletes) — andStoredEffect— the serialized write payload, non-null only while the entry is dirty and nulled once a flush persists it.TryGet— now sync —CreateOrGet,InnerCapturereplay,GetStatus,EffectPrinter) is cast-only: no serializer and no type-store resolution on reads. The write path is unchanged (eager serialization at capture,EnsurePersistedbefore flush).StoredEffectaccessorsEffect.GetStoredEffect/FlushlessSet;EffectResults.Setis reduced to the payload-less completion markerMarkneeds.StoredInputOutputtype (first commit).Deserialization failure fails the flow
A flow whose persisted effects cannot be deserialized under the running deployment is deterministic-broken — retrying cannot succeed.
ScheduleRestarttherefore fails the flow (persisting the exception and notifying any parent) instead of leaving it to the watchdog's endless retry cycle:TypeLoadException) or the serializer rejects the payload — are wrapped in a newEffectDeserializationExceptionand surfaced asFatalWorkflowException.ResolveType) still propagate raw, keeping the flow retryable — as does a failure of the fail-status write itself.Failedwith the deserialization error recorded and can be restarted explicitly after a fix/redeploy.Semantic changes
EffectValue.ForSerializationmaterialized value) instead of a fresh deserialized copy.Testing
New
EffectDeserializationFailureTestscover both deterministic failure modes (corrupt payload, unknown result type) end-to-end through the watchdog restart path. All suites green: Core 559, PostgreSQL 393, MariaDB 393, SqlServer 393 — 0 failures.🤖 Generated with Claude Code