Consider lazy durable entity state serialization semantics
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 30/100
Rechercherichtung
Beginnen Sie mit der zentralen Durable-Task-Entität StateShim und verfolgen Sie, wie set_state(), get_state(), der Abschluss von Operationen, Rollback und Löschung derzeit mit serialisiertem Zustand umgehen. Vergleichen Sie die Mutationssemantik mit anderen Durable Entity SDKs, bevor Sie entscheiden, ob eine verzögerte Serialisierung angemessen ist. Fügen Sie Tests für Mutationen nach set_state, Serialisierungsfehler, Rollback, Löschung, unveränderte Wire-Payloads und mehrere Operationen in einem Batch hinzu.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
Durable entity state is currently serialized eagerly when set_state() is called. This snapshots the value immediately, so mutations made to the same Python object after set_state() do not affect the state eventually persisted at the end of the operation.
state = Point(1)
self.set_state(state)
state.value = 99
The persisted state is Point(1), not Point(99).
This may surprise Python users who expect ordinary reference semantics and could introduce subtle bugs when entity code mutates an object after passing it to set_state().
Scope
The behavior is implemented in the core durabletask entity StateShim, so it affects core durabletask entities and providers built on it, including durabletask-azuremanaged and azure-functions-durable.
Current rationale
Eager serialization was introduced intentionally to:
- surface serialization errors inside the operation that called
set_state(); - preserve per-operation rollback behavior in an entity batch;
- retain the original serialized wire payload when state is unmodified; and
- prevent mutations to values returned by
get_state()from implicitly changing persisted state without a correspondingset_state().
Design question
Should set_state() retain the live value and defer serialization until successful operation completion, so mutations made after set_state() but before the operation returns are persisted?
If so, the design needs to define:
- whether
get_state()afterset_state()returns the same pending live object or a reconstructed copy; - where serialization occurs so serialization failures still fail and roll back the current operation;
- behavior across multiple operations in one entity batch;
- compatibility implications of changing
set_state()from snapshot-at-call semantics to retain-reference-until-commit semantics; and - consistency with Durable Entity semantics in other language SDKs.
Suggested investigation
- Compare mutation semantics with other Durable Entity SDKs.
- Prototype deferred serialization at the operation commit boundary.
- Add tests for post-
set_state()mutation, serialization failure, rollback, deletion, unmodified wire payloads, and multiple operations in one batch. - Document the current requirement to perform mutations before the final
set_state()call unless the behavior changes.
- Vorherrschende Sprache
- Python
- Sterne
- 40
- Forks
- 33
- Ø Merge
- 2 T. 2 Std.
- Gemergte PRs (30 T.)
- 6
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/durabletask-python
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 45/100
microsoft/durabletask-python#268 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 72/100
microsoft/durabletask-python#266 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 38/100
microsoft/durabletask-python#249 ·
-
bug Functions Parity
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
microsoft/durabletask-python#241 · 2 Kommentare ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 76/100
microsoft/durabletask-python#222 ·
Alle Issues in microsoft/durabletask-python
Ähnliche Issues
-
essnmx good first issue
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 95/100
-
[Feature] 奇物选择添加优先级 Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
syfoud/Simulated_Scepter#174 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Giskard-AI/giskard-oss#2840 · 1 Kommentar ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Offenarea: repo bug perceived difficulty: 2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
yeti-platform/yeti#1380 ·